[{"data":1,"prerenderedAt":6554},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/work-with-timestamps":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296,"expanded":13},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20,"expanded":13},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[342],{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"body":602,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},{"type":603,"children":604,"toc":6536},"root",[605,614,620,1061,1068,1073,1165,1172,1580,1586,2137,2143,2602,2608,2613,2619,3408,3414,4134,4140,5195,5201,5207,5369,5375,6341,6347,6503,6509,6514,6530],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"working-with-timestamps",[611],{"type":612,"value":613},"text","🔢 Working with Timestamps",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Unix timestamps are a universal way to represent time as seconds since January 1, 1970 (Unix epoch). They're essential for APIs, databases, and system integration. Python provides seamless conversion between datetime objects and timestamps.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","import time\nfrom datetime import datetime\n\n# Get current timestamp\ncurrent_timestamp = time.time()\ncurrent_dt_timestamp = datetime.now().timestamp()\n\nprint(f\"time.time(): {current_timestamp}\")\nprint(f\"datetime.timestamp(): {current_dt_timestamp}\")\n\n# Convert timestamp to datetime\ndt_from_timestamp = datetime.fromtimestamp(current_timestamp)\nprint(f\"From timestamp: {dt_from_timestamp}\")\n\n# Convert datetime to timestamp\ndt = datetime(2024, 3, 15, 14, 30, 45)\ntimestamp = dt.timestamp()\nprint(f\"DateTime {dt} → Timestamp: {timestamp}\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,652,674,682,691,709,726,733,783,825,832,840,857,898,905,913,985,1002],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640,646],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[644],{"type":612,"value":645},"import",{"type":606,"tag":636,"props":647,"children":649},{"style":648},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[650],{"type":612,"value":651}," time\n",{"type":606,"tag":636,"props":653,"children":654},{"class":638,"line":27},[655,660,665,669],{"type":606,"tag":636,"props":656,"children":657},{"style":642},[658],{"type":612,"value":659},"from",{"type":606,"tag":636,"props":661,"children":662},{"style":648},[663],{"type":612,"value":664}," datetime ",{"type":606,"tag":636,"props":666,"children":667},{"style":642},[668],{"type":612,"value":645},{"type":606,"tag":636,"props":670,"children":671},{"style":648},[672],{"type":612,"value":673}," datetime\n",{"type":606,"tag":636,"props":675,"children":676},{"class":638,"line":36},[677],{"type":606,"tag":636,"props":678,"children":679},{"emptyLinePlaceholder":13},[680],{"type":612,"value":681},"\n",{"type":606,"tag":636,"props":683,"children":684},{"class":638,"line":45},[685],{"type":606,"tag":636,"props":686,"children":688},{"style":687},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[689],{"type":612,"value":690},"# Get current timestamp\n",{"type":606,"tag":636,"props":692,"children":693},{"class":638,"line":54},[694,699,704],{"type":606,"tag":636,"props":695,"children":696},{"style":648},[697],{"type":612,"value":698},"current_timestamp ",{"type":606,"tag":636,"props":700,"children":701},{"style":642},[702],{"type":612,"value":703},"=",{"type":606,"tag":636,"props":705,"children":706},{"style":648},[707],{"type":612,"value":708}," time.time()\n",{"type":606,"tag":636,"props":710,"children":711},{"class":638,"line":63},[712,717,721],{"type":606,"tag":636,"props":713,"children":714},{"style":648},[715],{"type":612,"value":716},"current_dt_timestamp ",{"type":606,"tag":636,"props":718,"children":719},{"style":642},[720],{"type":612,"value":703},{"type":606,"tag":636,"props":722,"children":723},{"style":648},[724],{"type":612,"value":725}," datetime.now().timestamp()\n",{"type":606,"tag":636,"props":727,"children":728},{"class":638,"line":72},[729],{"type":606,"tag":636,"props":730,"children":731},{"emptyLinePlaceholder":13},[732],{"type":612,"value":681},{"type":606,"tag":636,"props":734,"children":735},{"class":638,"line":81},[736,742,747,752,758,763,768,773,778],{"type":606,"tag":636,"props":737,"children":739},{"style":738},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[740],{"type":612,"value":741},"print",{"type":606,"tag":636,"props":743,"children":744},{"style":648},[745],{"type":612,"value":746},"(",{"type":606,"tag":636,"props":748,"children":749},{"style":642},[750],{"type":612,"value":751},"f",{"type":606,"tag":636,"props":753,"children":755},{"style":754},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[756],{"type":612,"value":757},"\"time.time(): ",{"type":606,"tag":636,"props":759,"children":760},{"style":738},[761],{"type":612,"value":762},"{",{"type":606,"tag":636,"props":764,"children":765},{"style":648},[766],{"type":612,"value":767},"current_timestamp",{"type":606,"tag":636,"props":769,"children":770},{"style":738},[771],{"type":612,"value":772},"}",{"type":606,"tag":636,"props":774,"children":775},{"style":754},[776],{"type":612,"value":777},"\"",{"type":606,"tag":636,"props":779,"children":780},{"style":648},[781],{"type":612,"value":782},")\n",{"type":606,"tag":636,"props":784,"children":786},{"class":638,"line":785},9,[787,791,795,799,804,808,813,817,821],{"type":606,"tag":636,"props":788,"children":789},{"style":738},[790],{"type":612,"value":741},{"type":606,"tag":636,"props":792,"children":793},{"style":648},[794],{"type":612,"value":746},{"type":606,"tag":636,"props":796,"children":797},{"style":642},[798],{"type":612,"value":751},{"type":606,"tag":636,"props":800,"children":801},{"style":754},[802],{"type":612,"value":803},"\"datetime.timestamp(): ",{"type":606,"tag":636,"props":805,"children":806},{"style":738},[807],{"type":612,"value":762},{"type":606,"tag":636,"props":809,"children":810},{"style":648},[811],{"type":612,"value":812},"current_dt_timestamp",{"type":606,"tag":636,"props":814,"children":815},{"style":738},[816],{"type":612,"value":772},{"type":606,"tag":636,"props":818,"children":819},{"style":754},[820],{"type":612,"value":777},{"type":606,"tag":636,"props":822,"children":823},{"style":648},[824],{"type":612,"value":782},{"type":606,"tag":636,"props":826,"children":827},{"class":638,"line":99},[828],{"type":606,"tag":636,"props":829,"children":830},{"emptyLinePlaceholder":13},[831],{"type":612,"value":681},{"type":606,"tag":636,"props":833,"children":834},{"class":638,"line":108},[835],{"type":606,"tag":636,"props":836,"children":837},{"style":687},[838],{"type":612,"value":839},"# Convert timestamp to datetime\n",{"type":606,"tag":636,"props":841,"children":842},{"class":638,"line":117},[843,848,852],{"type":606,"tag":636,"props":844,"children":845},{"style":648},[846],{"type":612,"value":847},"dt_from_timestamp ",{"type":606,"tag":636,"props":849,"children":850},{"style":642},[851],{"type":612,"value":703},{"type":606,"tag":636,"props":853,"children":854},{"style":648},[855],{"type":612,"value":856}," datetime.fromtimestamp(current_timestamp)\n",{"type":606,"tag":636,"props":858,"children":859},{"class":638,"line":126},[860,864,868,872,877,881,886,890,894],{"type":606,"tag":636,"props":861,"children":862},{"style":738},[863],{"type":612,"value":741},{"type":606,"tag":636,"props":865,"children":866},{"style":648},[867],{"type":612,"value":746},{"type":606,"tag":636,"props":869,"children":870},{"style":642},[871],{"type":612,"value":751},{"type":606,"tag":636,"props":873,"children":874},{"style":754},[875],{"type":612,"value":876},"\"From timestamp: ",{"type":606,"tag":636,"props":878,"children":879},{"style":738},[880],{"type":612,"value":762},{"type":606,"tag":636,"props":882,"children":883},{"style":648},[884],{"type":612,"value":885},"dt_from_timestamp",{"type":606,"tag":636,"props":887,"children":888},{"style":738},[889],{"type":612,"value":772},{"type":606,"tag":636,"props":891,"children":892},{"style":754},[893],{"type":612,"value":777},{"type":606,"tag":636,"props":895,"children":896},{"style":648},[897],{"type":612,"value":782},{"type":606,"tag":636,"props":899,"children":900},{"class":638,"line":135},[901],{"type":606,"tag":636,"props":902,"children":903},{"emptyLinePlaceholder":13},[904],{"type":612,"value":681},{"type":606,"tag":636,"props":906,"children":907},{"class":638,"line":144},[908],{"type":606,"tag":636,"props":909,"children":910},{"style":687},[911],{"type":612,"value":912},"# Convert datetime to timestamp\n",{"type":606,"tag":636,"props":914,"children":915},{"class":638,"line":153},[916,921,925,930,935,940,945,949,954,958,963,967,972,976,981],{"type":606,"tag":636,"props":917,"children":918},{"style":648},[919],{"type":612,"value":920},"dt ",{"type":606,"tag":636,"props":922,"children":923},{"style":642},[924],{"type":612,"value":703},{"type":606,"tag":636,"props":926,"children":927},{"style":648},[928],{"type":612,"value":929}," datetime(",{"type":606,"tag":636,"props":931,"children":932},{"style":738},[933],{"type":612,"value":934},"2024",{"type":606,"tag":636,"props":936,"children":937},{"style":648},[938],{"type":612,"value":939},", ",{"type":606,"tag":636,"props":941,"children":942},{"style":738},[943],{"type":612,"value":944},"3",{"type":606,"tag":636,"props":946,"children":947},{"style":648},[948],{"type":612,"value":939},{"type":606,"tag":636,"props":950,"children":951},{"style":738},[952],{"type":612,"value":953},"15",{"type":606,"tag":636,"props":955,"children":956},{"style":648},[957],{"type":612,"value":939},{"type":606,"tag":636,"props":959,"children":960},{"style":738},[961],{"type":612,"value":962},"14",{"type":606,"tag":636,"props":964,"children":965},{"style":648},[966],{"type":612,"value":939},{"type":606,"tag":636,"props":968,"children":969},{"style":738},[970],{"type":612,"value":971},"30",{"type":606,"tag":636,"props":973,"children":974},{"style":648},[975],{"type":612,"value":939},{"type":606,"tag":636,"props":977,"children":978},{"style":738},[979],{"type":612,"value":980},"45",{"type":606,"tag":636,"props":982,"children":983},{"style":648},[984],{"type":612,"value":782},{"type":606,"tag":636,"props":986,"children":987},{"class":638,"line":163},[988,993,997],{"type":606,"tag":636,"props":989,"children":990},{"style":648},[991],{"type":612,"value":992},"timestamp ",{"type":606,"tag":636,"props":994,"children":995},{"style":642},[996],{"type":612,"value":703},{"type":606,"tag":636,"props":998,"children":999},{"style":648},[1000],{"type":612,"value":1001}," dt.timestamp()\n",{"type":606,"tag":636,"props":1003,"children":1004},{"class":638,"line":172},[1005,1009,1013,1017,1022,1026,1031,1035,1040,1044,1049,1053,1057],{"type":606,"tag":636,"props":1006,"children":1007},{"style":738},[1008],{"type":612,"value":741},{"type":606,"tag":636,"props":1010,"children":1011},{"style":648},[1012],{"type":612,"value":746},{"type":606,"tag":636,"props":1014,"children":1015},{"style":642},[1016],{"type":612,"value":751},{"type":606,"tag":636,"props":1018,"children":1019},{"style":754},[1020],{"type":612,"value":1021},"\"DateTime ",{"type":606,"tag":636,"props":1023,"children":1024},{"style":738},[1025],{"type":612,"value":762},{"type":606,"tag":636,"props":1027,"children":1028},{"style":648},[1029],{"type":612,"value":1030},"dt",{"type":606,"tag":636,"props":1032,"children":1033},{"style":738},[1034],{"type":612,"value":772},{"type":606,"tag":636,"props":1036,"children":1037},{"style":754},[1038],{"type":612,"value":1039}," → Timestamp: ",{"type":606,"tag":636,"props":1041,"children":1042},{"style":738},[1043],{"type":612,"value":762},{"type":606,"tag":636,"props":1045,"children":1046},{"style":648},[1047],{"type":612,"value":1048},"timestamp",{"type":606,"tag":636,"props":1050,"children":1051},{"style":738},[1052],{"type":612,"value":772},{"type":606,"tag":636,"props":1054,"children":1055},{"style":754},[1056],{"type":612,"value":777},{"type":606,"tag":636,"props":1058,"children":1059},{"style":648},[1060],{"type":612,"value":782},{"type":606,"tag":1062,"props":1063,"children":1065},"h2",{"id":1064},"understanding-unix-timestamps",[1066],{"type":612,"value":1067},"🎯 Understanding Unix Timestamps",{"type":606,"tag":615,"props":1069,"children":1070},{},[1071],{"type":612,"value":1072},"Unix timestamps count seconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).",{"type":606,"tag":1074,"props":1075,"children":1079},"info-box",{"emoji":1076,"title":1077,"type":1078},"⏰","Timestamp Essentials","info",[1080,1089,1114,1122,1145,1155],{"type":606,"tag":615,"props":1081,"children":1082},{},[1083],{"type":606,"tag":1084,"props":1085,"children":1086},"strong",{},[1087],{"type":612,"value":1088},"What is Unix Timestamp?",{"type":606,"tag":1090,"props":1091,"children":1092},"ul",{},[1093,1099,1104,1109],{"type":606,"tag":1094,"props":1095,"children":1096},"li",{},[1097],{"type":612,"value":1098},"Seconds since January 1, 1970 00:00:00 UTC",{"type":606,"tag":1094,"props":1100,"children":1101},{},[1102],{"type":612,"value":1103},"Universal time representation",{"type":606,"tag":1094,"props":1105,"children":1106},{},[1107],{"type":612,"value":1108},"Always in UTC (no timezone confusion)",{"type":606,"tag":1094,"props":1110,"children":1111},{},[1112],{"type":612,"value":1113},"Used by most computer systems",{"type":606,"tag":615,"props":1115,"children":1116},{},[1117],{"type":606,"tag":1084,"props":1118,"children":1119},{},[1120],{"type":612,"value":1121},"Advantages:",{"type":606,"tag":1090,"props":1123,"children":1124},{},[1125,1130,1135,1140],{"type":606,"tag":1094,"props":1126,"children":1127},{},[1128],{"type":612,"value":1129},"Language/system independent",{"type":606,"tag":1094,"props":1131,"children":1132},{},[1133],{"type":612,"value":1134},"Easy to compare and sort",{"type":606,"tag":1094,"props":1136,"children":1137},{},[1138],{"type":612,"value":1139},"Efficient storage (single number)",{"type":606,"tag":1094,"props":1141,"children":1142},{},[1143],{"type":612,"value":1144},"No timezone ambiguity",{"type":606,"tag":615,"props":1146,"children":1147},{},[1148,1153],{"type":606,"tag":1084,"props":1149,"children":1150},{},[1151],{"type":612,"value":1152},"Range:",{"type":612,"value":1154}," January 1, 1970 to January 19, 2038 (32-bit systems)",{"type":606,"tag":615,"props":1156,"children":1157},{},[1158,1163],{"type":606,"tag":1084,"props":1159,"children":1160},{},[1161],{"type":612,"value":1162},"Extended:",{"type":612,"value":1164}," Beyond 2038 on 64-bit systems",{"type":606,"tag":1166,"props":1167,"children":1169},"h3",{"id":1168},"creating-and-converting-timestamps",[1170],{"type":612,"value":1171},"Creating and Converting Timestamps",{"type":606,"tag":621,"props":1173,"children":1174},{},[1175],{"type":606,"tag":625,"props":1176,"children":1178},{"className":627,"code":1177,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime\n\n# Different ways to get current timestamp\ntimestamp1 = time.time()                    # Using time module\ntimestamp2 = datetime.now().timestamp()     # Using datetime\n\nprint(f\"time.time(): {timestamp1:.6f}\")\nprint(f\"datetime.now().timestamp(): {timestamp2:.6f}\")\n\n# Convert specific datetime to timestamp\nspecific_dt = datetime(2024, 1, 1, 0, 0, 0)\nnew_year_timestamp = specific_dt.timestamp()\nprint(f\"New Year 2024 timestamp: {new_year_timestamp}\")\n\n# Convert timestamp back to datetime\nback_to_dt = datetime.fromtimestamp(new_year_timestamp)\nprint(f\"Back to datetime: {back_to_dt}\")\n",[1179],{"type":606,"tag":632,"props":1180,"children":1181},{"__ignoreMap":8},[1182,1193,1212,1219,1227,1249,1271,1278,1323,1368,1375,1383,1449,1466,1507,1514,1522,1539],{"type":606,"tag":636,"props":1183,"children":1184},{"class":638,"line":12},[1185,1189],{"type":606,"tag":636,"props":1186,"children":1187},{"style":642},[1188],{"type":612,"value":645},{"type":606,"tag":636,"props":1190,"children":1191},{"style":648},[1192],{"type":612,"value":651},{"type":606,"tag":636,"props":1194,"children":1195},{"class":638,"line":27},[1196,1200,1204,1208],{"type":606,"tag":636,"props":1197,"children":1198},{"style":642},[1199],{"type":612,"value":659},{"type":606,"tag":636,"props":1201,"children":1202},{"style":648},[1203],{"type":612,"value":664},{"type":606,"tag":636,"props":1205,"children":1206},{"style":642},[1207],{"type":612,"value":645},{"type":606,"tag":636,"props":1209,"children":1210},{"style":648},[1211],{"type":612,"value":673},{"type":606,"tag":636,"props":1213,"children":1214},{"class":638,"line":36},[1215],{"type":606,"tag":636,"props":1216,"children":1217},{"emptyLinePlaceholder":13},[1218],{"type":612,"value":681},{"type":606,"tag":636,"props":1220,"children":1221},{"class":638,"line":45},[1222],{"type":606,"tag":636,"props":1223,"children":1224},{"style":687},[1225],{"type":612,"value":1226},"# Different ways to get current timestamp\n",{"type":606,"tag":636,"props":1228,"children":1229},{"class":638,"line":54},[1230,1235,1239,1244],{"type":606,"tag":636,"props":1231,"children":1232},{"style":648},[1233],{"type":612,"value":1234},"timestamp1 ",{"type":606,"tag":636,"props":1236,"children":1237},{"style":642},[1238],{"type":612,"value":703},{"type":606,"tag":636,"props":1240,"children":1241},{"style":648},[1242],{"type":612,"value":1243}," time.time()                    ",{"type":606,"tag":636,"props":1245,"children":1246},{"style":687},[1247],{"type":612,"value":1248},"# Using time module\n",{"type":606,"tag":636,"props":1250,"children":1251},{"class":638,"line":63},[1252,1257,1261,1266],{"type":606,"tag":636,"props":1253,"children":1254},{"style":648},[1255],{"type":612,"value":1256},"timestamp2 ",{"type":606,"tag":636,"props":1258,"children":1259},{"style":642},[1260],{"type":612,"value":703},{"type":606,"tag":636,"props":1262,"children":1263},{"style":648},[1264],{"type":612,"value":1265}," datetime.now().timestamp()     ",{"type":606,"tag":636,"props":1267,"children":1268},{"style":687},[1269],{"type":612,"value":1270},"# Using datetime\n",{"type":606,"tag":636,"props":1272,"children":1273},{"class":638,"line":72},[1274],{"type":606,"tag":636,"props":1275,"children":1276},{"emptyLinePlaceholder":13},[1277],{"type":612,"value":681},{"type":606,"tag":636,"props":1279,"children":1280},{"class":638,"line":81},[1281,1285,1289,1293,1297,1301,1306,1311,1315,1319],{"type":606,"tag":636,"props":1282,"children":1283},{"style":738},[1284],{"type":612,"value":741},{"type":606,"tag":636,"props":1286,"children":1287},{"style":648},[1288],{"type":612,"value":746},{"type":606,"tag":636,"props":1290,"children":1291},{"style":642},[1292],{"type":612,"value":751},{"type":606,"tag":636,"props":1294,"children":1295},{"style":754},[1296],{"type":612,"value":757},{"type":606,"tag":636,"props":1298,"children":1299},{"style":738},[1300],{"type":612,"value":762},{"type":606,"tag":636,"props":1302,"children":1303},{"style":648},[1304],{"type":612,"value":1305},"timestamp1",{"type":606,"tag":636,"props":1307,"children":1308},{"style":642},[1309],{"type":612,"value":1310},":.6f",{"type":606,"tag":636,"props":1312,"children":1313},{"style":738},[1314],{"type":612,"value":772},{"type":606,"tag":636,"props":1316,"children":1317},{"style":754},[1318],{"type":612,"value":777},{"type":606,"tag":636,"props":1320,"children":1321},{"style":648},[1322],{"type":612,"value":782},{"type":606,"tag":636,"props":1324,"children":1325},{"class":638,"line":785},[1326,1330,1334,1338,1343,1347,1352,1356,1360,1364],{"type":606,"tag":636,"props":1327,"children":1328},{"style":738},[1329],{"type":612,"value":741},{"type":606,"tag":636,"props":1331,"children":1332},{"style":648},[1333],{"type":612,"value":746},{"type":606,"tag":636,"props":1335,"children":1336},{"style":642},[1337],{"type":612,"value":751},{"type":606,"tag":636,"props":1339,"children":1340},{"style":754},[1341],{"type":612,"value":1342},"\"datetime.now().timestamp(): ",{"type":606,"tag":636,"props":1344,"children":1345},{"style":738},[1346],{"type":612,"value":762},{"type":606,"tag":636,"props":1348,"children":1349},{"style":648},[1350],{"type":612,"value":1351},"timestamp2",{"type":606,"tag":636,"props":1353,"children":1354},{"style":642},[1355],{"type":612,"value":1310},{"type":606,"tag":636,"props":1357,"children":1358},{"style":738},[1359],{"type":612,"value":772},{"type":606,"tag":636,"props":1361,"children":1362},{"style":754},[1363],{"type":612,"value":777},{"type":606,"tag":636,"props":1365,"children":1366},{"style":648},[1367],{"type":612,"value":782},{"type":606,"tag":636,"props":1369,"children":1370},{"class":638,"line":99},[1371],{"type":606,"tag":636,"props":1372,"children":1373},{"emptyLinePlaceholder":13},[1374],{"type":612,"value":681},{"type":606,"tag":636,"props":1376,"children":1377},{"class":638,"line":108},[1378],{"type":606,"tag":636,"props":1379,"children":1380},{"style":687},[1381],{"type":612,"value":1382},"# Convert specific datetime to timestamp\n",{"type":606,"tag":636,"props":1384,"children":1385},{"class":638,"line":117},[1386,1391,1395,1399,1403,1407,1412,1416,1420,1424,1429,1433,1437,1441,1445],{"type":606,"tag":636,"props":1387,"children":1388},{"style":648},[1389],{"type":612,"value":1390},"specific_dt ",{"type":606,"tag":636,"props":1392,"children":1393},{"style":642},[1394],{"type":612,"value":703},{"type":606,"tag":636,"props":1396,"children":1397},{"style":648},[1398],{"type":612,"value":929},{"type":606,"tag":636,"props":1400,"children":1401},{"style":738},[1402],{"type":612,"value":934},{"type":606,"tag":636,"props":1404,"children":1405},{"style":648},[1406],{"type":612,"value":939},{"type":606,"tag":636,"props":1408,"children":1409},{"style":738},[1410],{"type":612,"value":1411},"1",{"type":606,"tag":636,"props":1413,"children":1414},{"style":648},[1415],{"type":612,"value":939},{"type":606,"tag":636,"props":1417,"children":1418},{"style":738},[1419],{"type":612,"value":1411},{"type":606,"tag":636,"props":1421,"children":1422},{"style":648},[1423],{"type":612,"value":939},{"type":606,"tag":636,"props":1425,"children":1426},{"style":738},[1427],{"type":612,"value":1428},"0",{"type":606,"tag":636,"props":1430,"children":1431},{"style":648},[1432],{"type":612,"value":939},{"type":606,"tag":636,"props":1434,"children":1435},{"style":738},[1436],{"type":612,"value":1428},{"type":606,"tag":636,"props":1438,"children":1439},{"style":648},[1440],{"type":612,"value":939},{"type":606,"tag":636,"props":1442,"children":1443},{"style":738},[1444],{"type":612,"value":1428},{"type":606,"tag":636,"props":1446,"children":1447},{"style":648},[1448],{"type":612,"value":782},{"type":606,"tag":636,"props":1450,"children":1451},{"class":638,"line":126},[1452,1457,1461],{"type":606,"tag":636,"props":1453,"children":1454},{"style":648},[1455],{"type":612,"value":1456},"new_year_timestamp ",{"type":606,"tag":636,"props":1458,"children":1459},{"style":642},[1460],{"type":612,"value":703},{"type":606,"tag":636,"props":1462,"children":1463},{"style":648},[1464],{"type":612,"value":1465}," specific_dt.timestamp()\n",{"type":606,"tag":636,"props":1467,"children":1468},{"class":638,"line":135},[1469,1473,1477,1481,1486,1490,1495,1499,1503],{"type":606,"tag":636,"props":1470,"children":1471},{"style":738},[1472],{"type":612,"value":741},{"type":606,"tag":636,"props":1474,"children":1475},{"style":648},[1476],{"type":612,"value":746},{"type":606,"tag":636,"props":1478,"children":1479},{"style":642},[1480],{"type":612,"value":751},{"type":606,"tag":636,"props":1482,"children":1483},{"style":754},[1484],{"type":612,"value":1485},"\"New Year 2024 timestamp: ",{"type":606,"tag":636,"props":1487,"children":1488},{"style":738},[1489],{"type":612,"value":762},{"type":606,"tag":636,"props":1491,"children":1492},{"style":648},[1493],{"type":612,"value":1494},"new_year_timestamp",{"type":606,"tag":636,"props":1496,"children":1497},{"style":738},[1498],{"type":612,"value":772},{"type":606,"tag":636,"props":1500,"children":1501},{"style":754},[1502],{"type":612,"value":777},{"type":606,"tag":636,"props":1504,"children":1505},{"style":648},[1506],{"type":612,"value":782},{"type":606,"tag":636,"props":1508,"children":1509},{"class":638,"line":144},[1510],{"type":606,"tag":636,"props":1511,"children":1512},{"emptyLinePlaceholder":13},[1513],{"type":612,"value":681},{"type":606,"tag":636,"props":1515,"children":1516},{"class":638,"line":153},[1517],{"type":606,"tag":636,"props":1518,"children":1519},{"style":687},[1520],{"type":612,"value":1521},"# Convert timestamp back to datetime\n",{"type":606,"tag":636,"props":1523,"children":1524},{"class":638,"line":163},[1525,1530,1534],{"type":606,"tag":636,"props":1526,"children":1527},{"style":648},[1528],{"type":612,"value":1529},"back_to_dt ",{"type":606,"tag":636,"props":1531,"children":1532},{"style":642},[1533],{"type":612,"value":703},{"type":606,"tag":636,"props":1535,"children":1536},{"style":648},[1537],{"type":612,"value":1538}," datetime.fromtimestamp(new_year_timestamp)\n",{"type":606,"tag":636,"props":1540,"children":1541},{"class":638,"line":172},[1542,1546,1550,1554,1559,1563,1568,1572,1576],{"type":606,"tag":636,"props":1543,"children":1544},{"style":738},[1545],{"type":612,"value":741},{"type":606,"tag":636,"props":1547,"children":1548},{"style":648},[1549],{"type":612,"value":746},{"type":606,"tag":636,"props":1551,"children":1552},{"style":642},[1553],{"type":612,"value":751},{"type":606,"tag":636,"props":1555,"children":1556},{"style":754},[1557],{"type":612,"value":1558},"\"Back to datetime: ",{"type":606,"tag":636,"props":1560,"children":1561},{"style":738},[1562],{"type":612,"value":762},{"type":606,"tag":636,"props":1564,"children":1565},{"style":648},[1566],{"type":612,"value":1567},"back_to_dt",{"type":606,"tag":636,"props":1569,"children":1570},{"style":738},[1571],{"type":612,"value":772},{"type":606,"tag":636,"props":1573,"children":1574},{"style":754},[1575],{"type":612,"value":777},{"type":606,"tag":636,"props":1577,"children":1578},{"style":648},[1579],{"type":612,"value":782},{"type":606,"tag":1166,"props":1581,"children":1583},{"id":1582},"timestamp-precision",[1584],{"type":612,"value":1585},"Timestamp Precision",{"type":606,"tag":621,"props":1587,"children":1588},{},[1589],{"type":606,"tag":625,"props":1590,"children":1592},{"className":627,"code":1591,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime\n\n# Different timestamp precisions\ncurrent_time = datetime.now()\n\n# Standard timestamp (seconds)\nseconds_timestamp = int(current_time.timestamp())\nprint(f\"Seconds: {seconds_timestamp}\")\n\n# Milliseconds timestamp (common in JavaScript)\nmilliseconds_timestamp = int(current_time.timestamp() * 1000)\nprint(f\"Milliseconds: {milliseconds_timestamp}\")\n\n# Microseconds timestamp\nmicroseconds_timestamp = int(current_time.timestamp() * 1_000_000)\nprint(f\"Microseconds: {microseconds_timestamp}\")\n\n# Convert back from different precisions\nfrom_seconds = datetime.fromtimestamp(seconds_timestamp)\nfrom_milliseconds = datetime.fromtimestamp(milliseconds_timestamp / 1000)\nfrom_microseconds = datetime.fromtimestamp(microseconds_timestamp / 1_000_000)\n\nprint(f\"From seconds: {from_seconds}\")\nprint(f\"From milliseconds: {from_milliseconds}\")\nprint(f\"From microseconds: {from_microseconds}\")\n",[1593],{"type":606,"tag":632,"props":1594,"children":1595},{"__ignoreMap":8},[1596,1607,1626,1633,1641,1658,1665,1673,1695,1736,1743,1751,1786,1827,1834,1842,1875,1916,1923,1931,1948,1978,2007,2014,2055,2096],{"type":606,"tag":636,"props":1597,"children":1598},{"class":638,"line":12},[1599,1603],{"type":606,"tag":636,"props":1600,"children":1601},{"style":642},[1602],{"type":612,"value":645},{"type":606,"tag":636,"props":1604,"children":1605},{"style":648},[1606],{"type":612,"value":651},{"type":606,"tag":636,"props":1608,"children":1609},{"class":638,"line":27},[1610,1614,1618,1622],{"type":606,"tag":636,"props":1611,"children":1612},{"style":642},[1613],{"type":612,"value":659},{"type":606,"tag":636,"props":1615,"children":1616},{"style":648},[1617],{"type":612,"value":664},{"type":606,"tag":636,"props":1619,"children":1620},{"style":642},[1621],{"type":612,"value":645},{"type":606,"tag":636,"props":1623,"children":1624},{"style":648},[1625],{"type":612,"value":673},{"type":606,"tag":636,"props":1627,"children":1628},{"class":638,"line":36},[1629],{"type":606,"tag":636,"props":1630,"children":1631},{"emptyLinePlaceholder":13},[1632],{"type":612,"value":681},{"type":606,"tag":636,"props":1634,"children":1635},{"class":638,"line":45},[1636],{"type":606,"tag":636,"props":1637,"children":1638},{"style":687},[1639],{"type":612,"value":1640},"# Different timestamp precisions\n",{"type":606,"tag":636,"props":1642,"children":1643},{"class":638,"line":54},[1644,1649,1653],{"type":606,"tag":636,"props":1645,"children":1646},{"style":648},[1647],{"type":612,"value":1648},"current_time ",{"type":606,"tag":636,"props":1650,"children":1651},{"style":642},[1652],{"type":612,"value":703},{"type":606,"tag":636,"props":1654,"children":1655},{"style":648},[1656],{"type":612,"value":1657}," datetime.now()\n",{"type":606,"tag":636,"props":1659,"children":1660},{"class":638,"line":63},[1661],{"type":606,"tag":636,"props":1662,"children":1663},{"emptyLinePlaceholder":13},[1664],{"type":612,"value":681},{"type":606,"tag":636,"props":1666,"children":1667},{"class":638,"line":72},[1668],{"type":606,"tag":636,"props":1669,"children":1670},{"style":687},[1671],{"type":612,"value":1672},"# Standard timestamp (seconds)\n",{"type":606,"tag":636,"props":1674,"children":1675},{"class":638,"line":81},[1676,1681,1685,1690],{"type":606,"tag":636,"props":1677,"children":1678},{"style":648},[1679],{"type":612,"value":1680},"seconds_timestamp ",{"type":606,"tag":636,"props":1682,"children":1683},{"style":642},[1684],{"type":612,"value":703},{"type":606,"tag":636,"props":1686,"children":1687},{"style":738},[1688],{"type":612,"value":1689}," int",{"type":606,"tag":636,"props":1691,"children":1692},{"style":648},[1693],{"type":612,"value":1694},"(current_time.timestamp())\n",{"type":606,"tag":636,"props":1696,"children":1697},{"class":638,"line":785},[1698,1702,1706,1710,1715,1719,1724,1728,1732],{"type":606,"tag":636,"props":1699,"children":1700},{"style":738},[1701],{"type":612,"value":741},{"type":606,"tag":636,"props":1703,"children":1704},{"style":648},[1705],{"type":612,"value":746},{"type":606,"tag":636,"props":1707,"children":1708},{"style":642},[1709],{"type":612,"value":751},{"type":606,"tag":636,"props":1711,"children":1712},{"style":754},[1713],{"type":612,"value":1714},"\"Seconds: ",{"type":606,"tag":636,"props":1716,"children":1717},{"style":738},[1718],{"type":612,"value":762},{"type":606,"tag":636,"props":1720,"children":1721},{"style":648},[1722],{"type":612,"value":1723},"seconds_timestamp",{"type":606,"tag":636,"props":1725,"children":1726},{"style":738},[1727],{"type":612,"value":772},{"type":606,"tag":636,"props":1729,"children":1730},{"style":754},[1731],{"type":612,"value":777},{"type":606,"tag":636,"props":1733,"children":1734},{"style":648},[1735],{"type":612,"value":782},{"type":606,"tag":636,"props":1737,"children":1738},{"class":638,"line":99},[1739],{"type":606,"tag":636,"props":1740,"children":1741},{"emptyLinePlaceholder":13},[1742],{"type":612,"value":681},{"type":606,"tag":636,"props":1744,"children":1745},{"class":638,"line":108},[1746],{"type":606,"tag":636,"props":1747,"children":1748},{"style":687},[1749],{"type":612,"value":1750},"# Milliseconds timestamp (common in JavaScript)\n",{"type":606,"tag":636,"props":1752,"children":1753},{"class":638,"line":117},[1754,1759,1763,1767,1772,1777,1782],{"type":606,"tag":636,"props":1755,"children":1756},{"style":648},[1757],{"type":612,"value":1758},"milliseconds_timestamp ",{"type":606,"tag":636,"props":1760,"children":1761},{"style":642},[1762],{"type":612,"value":703},{"type":606,"tag":636,"props":1764,"children":1765},{"style":738},[1766],{"type":612,"value":1689},{"type":606,"tag":636,"props":1768,"children":1769},{"style":648},[1770],{"type":612,"value":1771},"(current_time.timestamp() ",{"type":606,"tag":636,"props":1773,"children":1774},{"style":642},[1775],{"type":612,"value":1776},"*",{"type":606,"tag":636,"props":1778,"children":1779},{"style":738},[1780],{"type":612,"value":1781}," 1000",{"type":606,"tag":636,"props":1783,"children":1784},{"style":648},[1785],{"type":612,"value":782},{"type":606,"tag":636,"props":1787,"children":1788},{"class":638,"line":126},[1789,1793,1797,1801,1806,1810,1815,1819,1823],{"type":606,"tag":636,"props":1790,"children":1791},{"style":738},[1792],{"type":612,"value":741},{"type":606,"tag":636,"props":1794,"children":1795},{"style":648},[1796],{"type":612,"value":746},{"type":606,"tag":636,"props":1798,"children":1799},{"style":642},[1800],{"type":612,"value":751},{"type":606,"tag":636,"props":1802,"children":1803},{"style":754},[1804],{"type":612,"value":1805},"\"Milliseconds: ",{"type":606,"tag":636,"props":1807,"children":1808},{"style":738},[1809],{"type":612,"value":762},{"type":606,"tag":636,"props":1811,"children":1812},{"style":648},[1813],{"type":612,"value":1814},"milliseconds_timestamp",{"type":606,"tag":636,"props":1816,"children":1817},{"style":738},[1818],{"type":612,"value":772},{"type":606,"tag":636,"props":1820,"children":1821},{"style":754},[1822],{"type":612,"value":777},{"type":606,"tag":636,"props":1824,"children":1825},{"style":648},[1826],{"type":612,"value":782},{"type":606,"tag":636,"props":1828,"children":1829},{"class":638,"line":135},[1830],{"type":606,"tag":636,"props":1831,"children":1832},{"emptyLinePlaceholder":13},[1833],{"type":612,"value":681},{"type":606,"tag":636,"props":1835,"children":1836},{"class":638,"line":144},[1837],{"type":606,"tag":636,"props":1838,"children":1839},{"style":687},[1840],{"type":612,"value":1841},"# Microseconds timestamp\n",{"type":606,"tag":636,"props":1843,"children":1844},{"class":638,"line":153},[1845,1850,1854,1858,1862,1866,1871],{"type":606,"tag":636,"props":1846,"children":1847},{"style":648},[1848],{"type":612,"value":1849},"microseconds_timestamp ",{"type":606,"tag":636,"props":1851,"children":1852},{"style":642},[1853],{"type":612,"value":703},{"type":606,"tag":636,"props":1855,"children":1856},{"style":738},[1857],{"type":612,"value":1689},{"type":606,"tag":636,"props":1859,"children":1860},{"style":648},[1861],{"type":612,"value":1771},{"type":606,"tag":636,"props":1863,"children":1864},{"style":642},[1865],{"type":612,"value":1776},{"type":606,"tag":636,"props":1867,"children":1868},{"style":738},[1869],{"type":612,"value":1870}," 1_000_000",{"type":606,"tag":636,"props":1872,"children":1873},{"style":648},[1874],{"type":612,"value":782},{"type":606,"tag":636,"props":1876,"children":1877},{"class":638,"line":163},[1878,1882,1886,1890,1895,1899,1904,1908,1912],{"type":606,"tag":636,"props":1879,"children":1880},{"style":738},[1881],{"type":612,"value":741},{"type":606,"tag":636,"props":1883,"children":1884},{"style":648},[1885],{"type":612,"value":746},{"type":606,"tag":636,"props":1887,"children":1888},{"style":642},[1889],{"type":612,"value":751},{"type":606,"tag":636,"props":1891,"children":1892},{"style":754},[1893],{"type":612,"value":1894},"\"Microseconds: ",{"type":606,"tag":636,"props":1896,"children":1897},{"style":738},[1898],{"type":612,"value":762},{"type":606,"tag":636,"props":1900,"children":1901},{"style":648},[1902],{"type":612,"value":1903},"microseconds_timestamp",{"type":606,"tag":636,"props":1905,"children":1906},{"style":738},[1907],{"type":612,"value":772},{"type":606,"tag":636,"props":1909,"children":1910},{"style":754},[1911],{"type":612,"value":777},{"type":606,"tag":636,"props":1913,"children":1914},{"style":648},[1915],{"type":612,"value":782},{"type":606,"tag":636,"props":1917,"children":1918},{"class":638,"line":172},[1919],{"type":606,"tag":636,"props":1920,"children":1921},{"emptyLinePlaceholder":13},[1922],{"type":612,"value":681},{"type":606,"tag":636,"props":1924,"children":1925},{"class":638,"line":181},[1926],{"type":606,"tag":636,"props":1927,"children":1928},{"style":687},[1929],{"type":612,"value":1930},"# Convert back from different precisions\n",{"type":606,"tag":636,"props":1932,"children":1933},{"class":638,"line":190},[1934,1939,1943],{"type":606,"tag":636,"props":1935,"children":1936},{"style":648},[1937],{"type":612,"value":1938},"from_seconds ",{"type":606,"tag":636,"props":1940,"children":1941},{"style":642},[1942],{"type":612,"value":703},{"type":606,"tag":636,"props":1944,"children":1945},{"style":648},[1946],{"type":612,"value":1947}," datetime.fromtimestamp(seconds_timestamp)\n",{"type":606,"tag":636,"props":1949,"children":1950},{"class":638,"line":199},[1951,1956,1960,1965,1970,1974],{"type":606,"tag":636,"props":1952,"children":1953},{"style":648},[1954],{"type":612,"value":1955},"from_milliseconds ",{"type":606,"tag":636,"props":1957,"children":1958},{"style":642},[1959],{"type":612,"value":703},{"type":606,"tag":636,"props":1961,"children":1962},{"style":648},[1963],{"type":612,"value":1964}," datetime.fromtimestamp(milliseconds_timestamp ",{"type":606,"tag":636,"props":1966,"children":1967},{"style":642},[1968],{"type":612,"value":1969},"/",{"type":606,"tag":636,"props":1971,"children":1972},{"style":738},[1973],{"type":612,"value":1781},{"type":606,"tag":636,"props":1975,"children":1976},{"style":648},[1977],{"type":612,"value":782},{"type":606,"tag":636,"props":1979,"children":1980},{"class":638,"line":208},[1981,1986,1990,1995,1999,2003],{"type":606,"tag":636,"props":1982,"children":1983},{"style":648},[1984],{"type":612,"value":1985},"from_microseconds ",{"type":606,"tag":636,"props":1987,"children":1988},{"style":642},[1989],{"type":612,"value":703},{"type":606,"tag":636,"props":1991,"children":1992},{"style":648},[1993],{"type":612,"value":1994}," datetime.fromtimestamp(microseconds_timestamp ",{"type":606,"tag":636,"props":1996,"children":1997},{"style":642},[1998],{"type":612,"value":1969},{"type":606,"tag":636,"props":2000,"children":2001},{"style":738},[2002],{"type":612,"value":1870},{"type":606,"tag":636,"props":2004,"children":2005},{"style":648},[2006],{"type":612,"value":782},{"type":606,"tag":636,"props":2008,"children":2009},{"class":638,"line":217},[2010],{"type":606,"tag":636,"props":2011,"children":2012},{"emptyLinePlaceholder":13},[2013],{"type":612,"value":681},{"type":606,"tag":636,"props":2015,"children":2016},{"class":638,"line":227},[2017,2021,2025,2029,2034,2038,2043,2047,2051],{"type":606,"tag":636,"props":2018,"children":2019},{"style":738},[2020],{"type":612,"value":741},{"type":606,"tag":636,"props":2022,"children":2023},{"style":648},[2024],{"type":612,"value":746},{"type":606,"tag":636,"props":2026,"children":2027},{"style":642},[2028],{"type":612,"value":751},{"type":606,"tag":636,"props":2030,"children":2031},{"style":754},[2032],{"type":612,"value":2033},"\"From seconds: ",{"type":606,"tag":636,"props":2035,"children":2036},{"style":738},[2037],{"type":612,"value":762},{"type":606,"tag":636,"props":2039,"children":2040},{"style":648},[2041],{"type":612,"value":2042},"from_seconds",{"type":606,"tag":636,"props":2044,"children":2045},{"style":738},[2046],{"type":612,"value":772},{"type":606,"tag":636,"props":2048,"children":2049},{"style":754},[2050],{"type":612,"value":777},{"type":606,"tag":636,"props":2052,"children":2053},{"style":648},[2054],{"type":612,"value":782},{"type":606,"tag":636,"props":2056,"children":2057},{"class":638,"line":236},[2058,2062,2066,2070,2075,2079,2084,2088,2092],{"type":606,"tag":636,"props":2059,"children":2060},{"style":738},[2061],{"type":612,"value":741},{"type":606,"tag":636,"props":2063,"children":2064},{"style":648},[2065],{"type":612,"value":746},{"type":606,"tag":636,"props":2067,"children":2068},{"style":642},[2069],{"type":612,"value":751},{"type":606,"tag":636,"props":2071,"children":2072},{"style":754},[2073],{"type":612,"value":2074},"\"From milliseconds: ",{"type":606,"tag":636,"props":2076,"children":2077},{"style":738},[2078],{"type":612,"value":762},{"type":606,"tag":636,"props":2080,"children":2081},{"style":648},[2082],{"type":612,"value":2083},"from_milliseconds",{"type":606,"tag":636,"props":2085,"children":2086},{"style":738},[2087],{"type":612,"value":772},{"type":606,"tag":636,"props":2089,"children":2090},{"style":754},[2091],{"type":612,"value":777},{"type":606,"tag":636,"props":2093,"children":2094},{"style":648},[2095],{"type":612,"value":782},{"type":606,"tag":636,"props":2097,"children":2098},{"class":638,"line":245},[2099,2103,2107,2111,2116,2120,2125,2129,2133],{"type":606,"tag":636,"props":2100,"children":2101},{"style":738},[2102],{"type":612,"value":741},{"type":606,"tag":636,"props":2104,"children":2105},{"style":648},[2106],{"type":612,"value":746},{"type":606,"tag":636,"props":2108,"children":2109},{"style":642},[2110],{"type":612,"value":751},{"type":606,"tag":636,"props":2112,"children":2113},{"style":754},[2114],{"type":612,"value":2115},"\"From microseconds: ",{"type":606,"tag":636,"props":2117,"children":2118},{"style":738},[2119],{"type":612,"value":762},{"type":606,"tag":636,"props":2121,"children":2122},{"style":648},[2123],{"type":612,"value":2124},"from_microseconds",{"type":606,"tag":636,"props":2126,"children":2127},{"style":738},[2128],{"type":612,"value":772},{"type":606,"tag":636,"props":2130,"children":2131},{"style":754},[2132],{"type":612,"value":777},{"type":606,"tag":636,"props":2134,"children":2135},{"style":648},[2136],{"type":612,"value":782},{"type":606,"tag":1166,"props":2138,"children":2140},{"id":2139},"utc-vs-local-timestamps",[2141],{"type":612,"value":2142},"UTC vs Local Timestamps",{"type":606,"tag":621,"props":2144,"children":2145},{},[2146],{"type":606,"tag":625,"props":2147,"children":2149},{"className":627,"code":2148,"language":629,"meta":8,"style":8},"from datetime import datetime, timezone\n\n# Local timestamp\nlocal_dt = datetime.now()\nlocal_timestamp = local_dt.timestamp()\n\n# UTC timestamp\nutc_dt = datetime.now(timezone.utc)\nutc_timestamp = utc_dt.timestamp()\n\nprint(f\"Local datetime: {local_dt}\")\nprint(f\"Local timestamp: {local_timestamp}\")\nprint(f\"UTC datetime: {utc_dt}\")\nprint(f\"UTC timestamp: {utc_timestamp}\")\n\n# Convert timestamp to UTC datetime\nutc_from_timestamp = datetime.fromtimestamp(local_timestamp, tz=timezone.utc)\nprint(f\"UTC from timestamp: {utc_from_timestamp}\")\n\n# Convert timestamp to local datetime\nlocal_from_timestamp = datetime.fromtimestamp(local_timestamp)\nprint(f\"Local from timestamp: {local_from_timestamp}\")\n",[2150],{"type":606,"tag":632,"props":2151,"children":2152},{"__ignoreMap":8},[2153,2173,2180,2188,2204,2221,2228,2236,2253,2270,2277,2318,2359,2400,2441,2448,2456,2488,2529,2536,2544,2561],{"type":606,"tag":636,"props":2154,"children":2155},{"class":638,"line":12},[2156,2160,2164,2168],{"type":606,"tag":636,"props":2157,"children":2158},{"style":642},[2159],{"type":612,"value":659},{"type":606,"tag":636,"props":2161,"children":2162},{"style":648},[2163],{"type":612,"value":664},{"type":606,"tag":636,"props":2165,"children":2166},{"style":642},[2167],{"type":612,"value":645},{"type":606,"tag":636,"props":2169,"children":2170},{"style":648},[2171],{"type":612,"value":2172}," datetime, timezone\n",{"type":606,"tag":636,"props":2174,"children":2175},{"class":638,"line":27},[2176],{"type":606,"tag":636,"props":2177,"children":2178},{"emptyLinePlaceholder":13},[2179],{"type":612,"value":681},{"type":606,"tag":636,"props":2181,"children":2182},{"class":638,"line":36},[2183],{"type":606,"tag":636,"props":2184,"children":2185},{"style":687},[2186],{"type":612,"value":2187},"# Local timestamp\n",{"type":606,"tag":636,"props":2189,"children":2190},{"class":638,"line":45},[2191,2196,2200],{"type":606,"tag":636,"props":2192,"children":2193},{"style":648},[2194],{"type":612,"value":2195},"local_dt ",{"type":606,"tag":636,"props":2197,"children":2198},{"style":642},[2199],{"type":612,"value":703},{"type":606,"tag":636,"props":2201,"children":2202},{"style":648},[2203],{"type":612,"value":1657},{"type":606,"tag":636,"props":2205,"children":2206},{"class":638,"line":54},[2207,2212,2216],{"type":606,"tag":636,"props":2208,"children":2209},{"style":648},[2210],{"type":612,"value":2211},"local_timestamp ",{"type":606,"tag":636,"props":2213,"children":2214},{"style":642},[2215],{"type":612,"value":703},{"type":606,"tag":636,"props":2217,"children":2218},{"style":648},[2219],{"type":612,"value":2220}," local_dt.timestamp()\n",{"type":606,"tag":636,"props":2222,"children":2223},{"class":638,"line":63},[2224],{"type":606,"tag":636,"props":2225,"children":2226},{"emptyLinePlaceholder":13},[2227],{"type":612,"value":681},{"type":606,"tag":636,"props":2229,"children":2230},{"class":638,"line":72},[2231],{"type":606,"tag":636,"props":2232,"children":2233},{"style":687},[2234],{"type":612,"value":2235},"# UTC timestamp\n",{"type":606,"tag":636,"props":2237,"children":2238},{"class":638,"line":81},[2239,2244,2248],{"type":606,"tag":636,"props":2240,"children":2241},{"style":648},[2242],{"type":612,"value":2243},"utc_dt ",{"type":606,"tag":636,"props":2245,"children":2246},{"style":642},[2247],{"type":612,"value":703},{"type":606,"tag":636,"props":2249,"children":2250},{"style":648},[2251],{"type":612,"value":2252}," datetime.now(timezone.utc)\n",{"type":606,"tag":636,"props":2254,"children":2255},{"class":638,"line":785},[2256,2261,2265],{"type":606,"tag":636,"props":2257,"children":2258},{"style":648},[2259],{"type":612,"value":2260},"utc_timestamp ",{"type":606,"tag":636,"props":2262,"children":2263},{"style":642},[2264],{"type":612,"value":703},{"type":606,"tag":636,"props":2266,"children":2267},{"style":648},[2268],{"type":612,"value":2269}," utc_dt.timestamp()\n",{"type":606,"tag":636,"props":2271,"children":2272},{"class":638,"line":99},[2273],{"type":606,"tag":636,"props":2274,"children":2275},{"emptyLinePlaceholder":13},[2276],{"type":612,"value":681},{"type":606,"tag":636,"props":2278,"children":2279},{"class":638,"line":108},[2280,2284,2288,2292,2297,2301,2306,2310,2314],{"type":606,"tag":636,"props":2281,"children":2282},{"style":738},[2283],{"type":612,"value":741},{"type":606,"tag":636,"props":2285,"children":2286},{"style":648},[2287],{"type":612,"value":746},{"type":606,"tag":636,"props":2289,"children":2290},{"style":642},[2291],{"type":612,"value":751},{"type":606,"tag":636,"props":2293,"children":2294},{"style":754},[2295],{"type":612,"value":2296},"\"Local datetime: ",{"type":606,"tag":636,"props":2298,"children":2299},{"style":738},[2300],{"type":612,"value":762},{"type":606,"tag":636,"props":2302,"children":2303},{"style":648},[2304],{"type":612,"value":2305},"local_dt",{"type":606,"tag":636,"props":2307,"children":2308},{"style":738},[2309],{"type":612,"value":772},{"type":606,"tag":636,"props":2311,"children":2312},{"style":754},[2313],{"type":612,"value":777},{"type":606,"tag":636,"props":2315,"children":2316},{"style":648},[2317],{"type":612,"value":782},{"type":606,"tag":636,"props":2319,"children":2320},{"class":638,"line":117},[2321,2325,2329,2333,2338,2342,2347,2351,2355],{"type":606,"tag":636,"props":2322,"children":2323},{"style":738},[2324],{"type":612,"value":741},{"type":606,"tag":636,"props":2326,"children":2327},{"style":648},[2328],{"type":612,"value":746},{"type":606,"tag":636,"props":2330,"children":2331},{"style":642},[2332],{"type":612,"value":751},{"type":606,"tag":636,"props":2334,"children":2335},{"style":754},[2336],{"type":612,"value":2337},"\"Local timestamp: ",{"type":606,"tag":636,"props":2339,"children":2340},{"style":738},[2341],{"type":612,"value":762},{"type":606,"tag":636,"props":2343,"children":2344},{"style":648},[2345],{"type":612,"value":2346},"local_timestamp",{"type":606,"tag":636,"props":2348,"children":2349},{"style":738},[2350],{"type":612,"value":772},{"type":606,"tag":636,"props":2352,"children":2353},{"style":754},[2354],{"type":612,"value":777},{"type":606,"tag":636,"props":2356,"children":2357},{"style":648},[2358],{"type":612,"value":782},{"type":606,"tag":636,"props":2360,"children":2361},{"class":638,"line":126},[2362,2366,2370,2374,2379,2383,2388,2392,2396],{"type":606,"tag":636,"props":2363,"children":2364},{"style":738},[2365],{"type":612,"value":741},{"type":606,"tag":636,"props":2367,"children":2368},{"style":648},[2369],{"type":612,"value":746},{"type":606,"tag":636,"props":2371,"children":2372},{"style":642},[2373],{"type":612,"value":751},{"type":606,"tag":636,"props":2375,"children":2376},{"style":754},[2377],{"type":612,"value":2378},"\"UTC datetime: ",{"type":606,"tag":636,"props":2380,"children":2381},{"style":738},[2382],{"type":612,"value":762},{"type":606,"tag":636,"props":2384,"children":2385},{"style":648},[2386],{"type":612,"value":2387},"utc_dt",{"type":606,"tag":636,"props":2389,"children":2390},{"style":738},[2391],{"type":612,"value":772},{"type":606,"tag":636,"props":2393,"children":2394},{"style":754},[2395],{"type":612,"value":777},{"type":606,"tag":636,"props":2397,"children":2398},{"style":648},[2399],{"type":612,"value":782},{"type":606,"tag":636,"props":2401,"children":2402},{"class":638,"line":135},[2403,2407,2411,2415,2420,2424,2429,2433,2437],{"type":606,"tag":636,"props":2404,"children":2405},{"style":738},[2406],{"type":612,"value":741},{"type":606,"tag":636,"props":2408,"children":2409},{"style":648},[2410],{"type":612,"value":746},{"type":606,"tag":636,"props":2412,"children":2413},{"style":642},[2414],{"type":612,"value":751},{"type":606,"tag":636,"props":2416,"children":2417},{"style":754},[2418],{"type":612,"value":2419},"\"UTC timestamp: ",{"type":606,"tag":636,"props":2421,"children":2422},{"style":738},[2423],{"type":612,"value":762},{"type":606,"tag":636,"props":2425,"children":2426},{"style":648},[2427],{"type":612,"value":2428},"utc_timestamp",{"type":606,"tag":636,"props":2430,"children":2431},{"style":738},[2432],{"type":612,"value":772},{"type":606,"tag":636,"props":2434,"children":2435},{"style":754},[2436],{"type":612,"value":777},{"type":606,"tag":636,"props":2438,"children":2439},{"style":648},[2440],{"type":612,"value":782},{"type":606,"tag":636,"props":2442,"children":2443},{"class":638,"line":144},[2444],{"type":606,"tag":636,"props":2445,"children":2446},{"emptyLinePlaceholder":13},[2447],{"type":612,"value":681},{"type":606,"tag":636,"props":2449,"children":2450},{"class":638,"line":153},[2451],{"type":606,"tag":636,"props":2452,"children":2453},{"style":687},[2454],{"type":612,"value":2455},"# Convert timestamp to UTC datetime\n",{"type":606,"tag":636,"props":2457,"children":2458},{"class":638,"line":163},[2459,2464,2468,2473,2479,2483],{"type":606,"tag":636,"props":2460,"children":2461},{"style":648},[2462],{"type":612,"value":2463},"utc_from_timestamp ",{"type":606,"tag":636,"props":2465,"children":2466},{"style":642},[2467],{"type":612,"value":703},{"type":606,"tag":636,"props":2469,"children":2470},{"style":648},[2471],{"type":612,"value":2472}," datetime.fromtimestamp(local_timestamp, ",{"type":606,"tag":636,"props":2474,"children":2476},{"style":2475},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[2477],{"type":612,"value":2478},"tz",{"type":606,"tag":636,"props":2480,"children":2481},{"style":642},[2482],{"type":612,"value":703},{"type":606,"tag":636,"props":2484,"children":2485},{"style":648},[2486],{"type":612,"value":2487},"timezone.utc)\n",{"type":606,"tag":636,"props":2489,"children":2490},{"class":638,"line":172},[2491,2495,2499,2503,2508,2512,2517,2521,2525],{"type":606,"tag":636,"props":2492,"children":2493},{"style":738},[2494],{"type":612,"value":741},{"type":606,"tag":636,"props":2496,"children":2497},{"style":648},[2498],{"type":612,"value":746},{"type":606,"tag":636,"props":2500,"children":2501},{"style":642},[2502],{"type":612,"value":751},{"type":606,"tag":636,"props":2504,"children":2505},{"style":754},[2506],{"type":612,"value":2507},"\"UTC from timestamp: ",{"type":606,"tag":636,"props":2509,"children":2510},{"style":738},[2511],{"type":612,"value":762},{"type":606,"tag":636,"props":2513,"children":2514},{"style":648},[2515],{"type":612,"value":2516},"utc_from_timestamp",{"type":606,"tag":636,"props":2518,"children":2519},{"style":738},[2520],{"type":612,"value":772},{"type":606,"tag":636,"props":2522,"children":2523},{"style":754},[2524],{"type":612,"value":777},{"type":606,"tag":636,"props":2526,"children":2527},{"style":648},[2528],{"type":612,"value":782},{"type":606,"tag":636,"props":2530,"children":2531},{"class":638,"line":181},[2532],{"type":606,"tag":636,"props":2533,"children":2534},{"emptyLinePlaceholder":13},[2535],{"type":612,"value":681},{"type":606,"tag":636,"props":2537,"children":2538},{"class":638,"line":190},[2539],{"type":606,"tag":636,"props":2540,"children":2541},{"style":687},[2542],{"type":612,"value":2543},"# Convert timestamp to local datetime\n",{"type":606,"tag":636,"props":2545,"children":2546},{"class":638,"line":199},[2547,2552,2556],{"type":606,"tag":636,"props":2548,"children":2549},{"style":648},[2550],{"type":612,"value":2551},"local_from_timestamp ",{"type":606,"tag":636,"props":2553,"children":2554},{"style":642},[2555],{"type":612,"value":703},{"type":606,"tag":636,"props":2557,"children":2558},{"style":648},[2559],{"type":612,"value":2560}," datetime.fromtimestamp(local_timestamp)\n",{"type":606,"tag":636,"props":2562,"children":2563},{"class":638,"line":208},[2564,2568,2572,2576,2581,2585,2590,2594,2598],{"type":606,"tag":636,"props":2565,"children":2566},{"style":738},[2567],{"type":612,"value":741},{"type":606,"tag":636,"props":2569,"children":2570},{"style":648},[2571],{"type":612,"value":746},{"type":606,"tag":636,"props":2573,"children":2574},{"style":642},[2575],{"type":612,"value":751},{"type":606,"tag":636,"props":2577,"children":2578},{"style":754},[2579],{"type":612,"value":2580},"\"Local from timestamp: ",{"type":606,"tag":636,"props":2582,"children":2583},{"style":738},[2584],{"type":612,"value":762},{"type":606,"tag":636,"props":2586,"children":2587},{"style":648},[2588],{"type":612,"value":2589},"local_from_timestamp",{"type":606,"tag":636,"props":2591,"children":2592},{"style":738},[2593],{"type":612,"value":772},{"type":606,"tag":636,"props":2595,"children":2596},{"style":754},[2597],{"type":612,"value":777},{"type":606,"tag":636,"props":2599,"children":2600},{"style":648},[2601],{"type":612,"value":782},{"type":606,"tag":1062,"props":2603,"children":2605},{"id":2604},"️-practical-timestamp-operations",[2606],{"type":612,"value":2607},"🛠️ Practical Timestamp Operations",{"type":606,"tag":615,"props":2609,"children":2610},{},[2611],{"type":612,"value":2612},"Common operations you'll need when working with timestamps.",{"type":606,"tag":1166,"props":2614,"children":2616},{"id":2615},"timestamp-utilities",[2617],{"type":612,"value":2618},"Timestamp Utilities",{"type":606,"tag":621,"props":2620,"children":2621},{},[2622],{"type":606,"tag":625,"props":2623,"children":2625},{"className":627,"code":2624,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime, timezone\n\ndef current_timestamp_ms():\n    \"\"\"Get current timestamp in milliseconds\"\"\"\n    return int(time.time() * 1000)\n\ndef timestamp_to_datetime(timestamp, is_milliseconds=False):\n    \"\"\"Convert timestamp to datetime, handling both seconds and milliseconds\"\"\"\n    if is_milliseconds:\n        timestamp = timestamp / 1000\n    return datetime.fromtimestamp(timestamp)\n\ndef datetime_to_timestamp_ms(dt):\n    \"\"\"Convert datetime to milliseconds timestamp\"\"\"\n    return int(dt.timestamp() * 1000)\n\ndef is_valid_timestamp(timestamp, min_year=1970, max_year=2100):\n    \"\"\"Check if timestamp is within reasonable range\"\"\"\n    try:\n        dt = datetime.fromtimestamp(timestamp)\n        return min_year \u003C= dt.year \u003C= max_year\n    except (ValueError, OSError):\n        return False\n\n# Example usage\ncurrent_ms = current_timestamp_ms()\nprint(f\"Current timestamp (ms): {current_ms}\")\n\n# Test timestamp validation\ntest_timestamps = [\n    time.time(),           # Valid current time\n    1234567890,           # Valid past time (2009)\n    12345,                # Invalid (too early)\n    9999999999,           # Invalid (too late for 32-bit)\n]\n\nfor ts in test_timestamps:\n    valid = is_valid_timestamp(ts)\n    if valid:\n        dt = timestamp_to_datetime(ts)\n        print(f\"✓ {ts} → {dt}\")\n    else:\n        print(f\"✗ {ts} → Invalid timestamp\")\n",[2626],{"type":606,"tag":632,"props":2627,"children":2628},{"__ignoreMap":8},[2629,2640,2659,2666,2685,2693,2722,2729,2760,2768,2781,2807,2819,2826,2843,2851,2879,2886,2930,2938,2951,2967,2999,3030,3042,3049,3057,3074,3115,3122,3130,3147,3160,3178,3196,3213,3221,3228,3251,3268,3280,3296,3355,3367],{"type":606,"tag":636,"props":2630,"children":2631},{"class":638,"line":12},[2632,2636],{"type":606,"tag":636,"props":2633,"children":2634},{"style":642},[2635],{"type":612,"value":645},{"type":606,"tag":636,"props":2637,"children":2638},{"style":648},[2639],{"type":612,"value":651},{"type":606,"tag":636,"props":2641,"children":2642},{"class":638,"line":27},[2643,2647,2651,2655],{"type":606,"tag":636,"props":2644,"children":2645},{"style":642},[2646],{"type":612,"value":659},{"type":606,"tag":636,"props":2648,"children":2649},{"style":648},[2650],{"type":612,"value":664},{"type":606,"tag":636,"props":2652,"children":2653},{"style":642},[2654],{"type":612,"value":645},{"type":606,"tag":636,"props":2656,"children":2657},{"style":648},[2658],{"type":612,"value":2172},{"type":606,"tag":636,"props":2660,"children":2661},{"class":638,"line":36},[2662],{"type":606,"tag":636,"props":2663,"children":2664},{"emptyLinePlaceholder":13},[2665],{"type":612,"value":681},{"type":606,"tag":636,"props":2667,"children":2668},{"class":638,"line":45},[2669,2674,2680],{"type":606,"tag":636,"props":2670,"children":2671},{"style":642},[2672],{"type":612,"value":2673},"def",{"type":606,"tag":636,"props":2675,"children":2677},{"style":2676},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2678],{"type":612,"value":2679}," current_timestamp_ms",{"type":606,"tag":636,"props":2681,"children":2682},{"style":648},[2683],{"type":612,"value":2684},"():\n",{"type":606,"tag":636,"props":2686,"children":2687},{"class":638,"line":54},[2688],{"type":606,"tag":636,"props":2689,"children":2690},{"style":754},[2691],{"type":612,"value":2692},"    \"\"\"Get current timestamp in milliseconds\"\"\"\n",{"type":606,"tag":636,"props":2694,"children":2695},{"class":638,"line":63},[2696,2701,2705,2710,2714,2718],{"type":606,"tag":636,"props":2697,"children":2698},{"style":642},[2699],{"type":612,"value":2700},"    return",{"type":606,"tag":636,"props":2702,"children":2703},{"style":738},[2704],{"type":612,"value":1689},{"type":606,"tag":636,"props":2706,"children":2707},{"style":648},[2708],{"type":612,"value":2709},"(time.time() ",{"type":606,"tag":636,"props":2711,"children":2712},{"style":642},[2713],{"type":612,"value":1776},{"type":606,"tag":636,"props":2715,"children":2716},{"style":738},[2717],{"type":612,"value":1781},{"type":606,"tag":636,"props":2719,"children":2720},{"style":648},[2721],{"type":612,"value":782},{"type":606,"tag":636,"props":2723,"children":2724},{"class":638,"line":72},[2725],{"type":606,"tag":636,"props":2726,"children":2727},{"emptyLinePlaceholder":13},[2728],{"type":612,"value":681},{"type":606,"tag":636,"props":2730,"children":2731},{"class":638,"line":81},[2732,2736,2741,2746,2750,2755],{"type":606,"tag":636,"props":2733,"children":2734},{"style":642},[2735],{"type":612,"value":2673},{"type":606,"tag":636,"props":2737,"children":2738},{"style":2676},[2739],{"type":612,"value":2740}," timestamp_to_datetime",{"type":606,"tag":636,"props":2742,"children":2743},{"style":648},[2744],{"type":612,"value":2745},"(timestamp, is_milliseconds",{"type":606,"tag":636,"props":2747,"children":2748},{"style":642},[2749],{"type":612,"value":703},{"type":606,"tag":636,"props":2751,"children":2752},{"style":738},[2753],{"type":612,"value":2754},"False",{"type":606,"tag":636,"props":2756,"children":2757},{"style":648},[2758],{"type":612,"value":2759},"):\n",{"type":606,"tag":636,"props":2761,"children":2762},{"class":638,"line":785},[2763],{"type":606,"tag":636,"props":2764,"children":2765},{"style":754},[2766],{"type":612,"value":2767},"    \"\"\"Convert timestamp to datetime, handling both seconds and milliseconds\"\"\"\n",{"type":606,"tag":636,"props":2769,"children":2770},{"class":638,"line":99},[2771,2776],{"type":606,"tag":636,"props":2772,"children":2773},{"style":642},[2774],{"type":612,"value":2775},"    if",{"type":606,"tag":636,"props":2777,"children":2778},{"style":648},[2779],{"type":612,"value":2780}," is_milliseconds:\n",{"type":606,"tag":636,"props":2782,"children":2783},{"class":638,"line":108},[2784,2789,2793,2798,2802],{"type":606,"tag":636,"props":2785,"children":2786},{"style":648},[2787],{"type":612,"value":2788},"        timestamp ",{"type":606,"tag":636,"props":2790,"children":2791},{"style":642},[2792],{"type":612,"value":703},{"type":606,"tag":636,"props":2794,"children":2795},{"style":648},[2796],{"type":612,"value":2797}," timestamp ",{"type":606,"tag":636,"props":2799,"children":2800},{"style":642},[2801],{"type":612,"value":1969},{"type":606,"tag":636,"props":2803,"children":2804},{"style":738},[2805],{"type":612,"value":2806}," 1000\n",{"type":606,"tag":636,"props":2808,"children":2809},{"class":638,"line":117},[2810,2814],{"type":606,"tag":636,"props":2811,"children":2812},{"style":642},[2813],{"type":612,"value":2700},{"type":606,"tag":636,"props":2815,"children":2816},{"style":648},[2817],{"type":612,"value":2818}," datetime.fromtimestamp(timestamp)\n",{"type":606,"tag":636,"props":2820,"children":2821},{"class":638,"line":126},[2822],{"type":606,"tag":636,"props":2823,"children":2824},{"emptyLinePlaceholder":13},[2825],{"type":612,"value":681},{"type":606,"tag":636,"props":2827,"children":2828},{"class":638,"line":135},[2829,2833,2838],{"type":606,"tag":636,"props":2830,"children":2831},{"style":642},[2832],{"type":612,"value":2673},{"type":606,"tag":636,"props":2834,"children":2835},{"style":2676},[2836],{"type":612,"value":2837}," datetime_to_timestamp_ms",{"type":606,"tag":636,"props":2839,"children":2840},{"style":648},[2841],{"type":612,"value":2842},"(dt):\n",{"type":606,"tag":636,"props":2844,"children":2845},{"class":638,"line":144},[2846],{"type":606,"tag":636,"props":2847,"children":2848},{"style":754},[2849],{"type":612,"value":2850},"    \"\"\"Convert datetime to milliseconds timestamp\"\"\"\n",{"type":606,"tag":636,"props":2852,"children":2853},{"class":638,"line":153},[2854,2858,2862,2867,2871,2875],{"type":606,"tag":636,"props":2855,"children":2856},{"style":642},[2857],{"type":612,"value":2700},{"type":606,"tag":636,"props":2859,"children":2860},{"style":738},[2861],{"type":612,"value":1689},{"type":606,"tag":636,"props":2863,"children":2864},{"style":648},[2865],{"type":612,"value":2866},"(dt.timestamp() ",{"type":606,"tag":636,"props":2868,"children":2869},{"style":642},[2870],{"type":612,"value":1776},{"type":606,"tag":636,"props":2872,"children":2873},{"style":738},[2874],{"type":612,"value":1781},{"type":606,"tag":636,"props":2876,"children":2877},{"style":648},[2878],{"type":612,"value":782},{"type":606,"tag":636,"props":2880,"children":2881},{"class":638,"line":163},[2882],{"type":606,"tag":636,"props":2883,"children":2884},{"emptyLinePlaceholder":13},[2885],{"type":612,"value":681},{"type":606,"tag":636,"props":2887,"children":2888},{"class":638,"line":172},[2889,2893,2898,2903,2907,2912,2917,2921,2926],{"type":606,"tag":636,"props":2890,"children":2891},{"style":642},[2892],{"type":612,"value":2673},{"type":606,"tag":636,"props":2894,"children":2895},{"style":2676},[2896],{"type":612,"value":2897}," is_valid_timestamp",{"type":606,"tag":636,"props":2899,"children":2900},{"style":648},[2901],{"type":612,"value":2902},"(timestamp, min_year",{"type":606,"tag":636,"props":2904,"children":2905},{"style":642},[2906],{"type":612,"value":703},{"type":606,"tag":636,"props":2908,"children":2909},{"style":738},[2910],{"type":612,"value":2911},"1970",{"type":606,"tag":636,"props":2913,"children":2914},{"style":648},[2915],{"type":612,"value":2916},", max_year",{"type":606,"tag":636,"props":2918,"children":2919},{"style":642},[2920],{"type":612,"value":703},{"type":606,"tag":636,"props":2922,"children":2923},{"style":738},[2924],{"type":612,"value":2925},"2100",{"type":606,"tag":636,"props":2927,"children":2928},{"style":648},[2929],{"type":612,"value":2759},{"type":606,"tag":636,"props":2931,"children":2932},{"class":638,"line":181},[2933],{"type":606,"tag":636,"props":2934,"children":2935},{"style":754},[2936],{"type":612,"value":2937},"    \"\"\"Check if timestamp is within reasonable range\"\"\"\n",{"type":606,"tag":636,"props":2939,"children":2940},{"class":638,"line":190},[2941,2946],{"type":606,"tag":636,"props":2942,"children":2943},{"style":642},[2944],{"type":612,"value":2945},"    try",{"type":606,"tag":636,"props":2947,"children":2948},{"style":648},[2949],{"type":612,"value":2950},":\n",{"type":606,"tag":636,"props":2952,"children":2953},{"class":638,"line":199},[2954,2959,2963],{"type":606,"tag":636,"props":2955,"children":2956},{"style":648},[2957],{"type":612,"value":2958},"        dt ",{"type":606,"tag":636,"props":2960,"children":2961},{"style":642},[2962],{"type":612,"value":703},{"type":606,"tag":636,"props":2964,"children":2965},{"style":648},[2966],{"type":612,"value":2818},{"type":606,"tag":636,"props":2968,"children":2969},{"class":638,"line":208},[2970,2975,2980,2985,2990,2994],{"type":606,"tag":636,"props":2971,"children":2972},{"style":642},[2973],{"type":612,"value":2974},"        return",{"type":606,"tag":636,"props":2976,"children":2977},{"style":648},[2978],{"type":612,"value":2979}," min_year ",{"type":606,"tag":636,"props":2981,"children":2982},{"style":642},[2983],{"type":612,"value":2984},"\u003C=",{"type":606,"tag":636,"props":2986,"children":2987},{"style":648},[2988],{"type":612,"value":2989}," dt.year ",{"type":606,"tag":636,"props":2991,"children":2992},{"style":642},[2993],{"type":612,"value":2984},{"type":606,"tag":636,"props":2995,"children":2996},{"style":648},[2997],{"type":612,"value":2998}," max_year\n",{"type":606,"tag":636,"props":3000,"children":3001},{"class":638,"line":217},[3002,3007,3012,3017,3021,3026],{"type":606,"tag":636,"props":3003,"children":3004},{"style":642},[3005],{"type":612,"value":3006},"    except",{"type":606,"tag":636,"props":3008,"children":3009},{"style":648},[3010],{"type":612,"value":3011}," (",{"type":606,"tag":636,"props":3013,"children":3014},{"style":738},[3015],{"type":612,"value":3016},"ValueError",{"type":606,"tag":636,"props":3018,"children":3019},{"style":648},[3020],{"type":612,"value":939},{"type":606,"tag":636,"props":3022,"children":3023},{"style":738},[3024],{"type":612,"value":3025},"OSError",{"type":606,"tag":636,"props":3027,"children":3028},{"style":648},[3029],{"type":612,"value":2759},{"type":606,"tag":636,"props":3031,"children":3032},{"class":638,"line":227},[3033,3037],{"type":606,"tag":636,"props":3034,"children":3035},{"style":642},[3036],{"type":612,"value":2974},{"type":606,"tag":636,"props":3038,"children":3039},{"style":738},[3040],{"type":612,"value":3041}," False\n",{"type":606,"tag":636,"props":3043,"children":3044},{"class":638,"line":236},[3045],{"type":606,"tag":636,"props":3046,"children":3047},{"emptyLinePlaceholder":13},[3048],{"type":612,"value":681},{"type":606,"tag":636,"props":3050,"children":3051},{"class":638,"line":245},[3052],{"type":606,"tag":636,"props":3053,"children":3054},{"style":687},[3055],{"type":612,"value":3056},"# Example usage\n",{"type":606,"tag":636,"props":3058,"children":3059},{"class":638,"line":254},[3060,3065,3069],{"type":606,"tag":636,"props":3061,"children":3062},{"style":648},[3063],{"type":612,"value":3064},"current_ms ",{"type":606,"tag":636,"props":3066,"children":3067},{"style":642},[3068],{"type":612,"value":703},{"type":606,"tag":636,"props":3070,"children":3071},{"style":648},[3072],{"type":612,"value":3073}," current_timestamp_ms()\n",{"type":606,"tag":636,"props":3075,"children":3076},{"class":638,"line":263},[3077,3081,3085,3089,3094,3098,3103,3107,3111],{"type":606,"tag":636,"props":3078,"children":3079},{"style":738},[3080],{"type":612,"value":741},{"type":606,"tag":636,"props":3082,"children":3083},{"style":648},[3084],{"type":612,"value":746},{"type":606,"tag":636,"props":3086,"children":3087},{"style":642},[3088],{"type":612,"value":751},{"type":606,"tag":636,"props":3090,"children":3091},{"style":754},[3092],{"type":612,"value":3093},"\"Current timestamp (ms): ",{"type":606,"tag":636,"props":3095,"children":3096},{"style":738},[3097],{"type":612,"value":762},{"type":606,"tag":636,"props":3099,"children":3100},{"style":648},[3101],{"type":612,"value":3102},"current_ms",{"type":606,"tag":636,"props":3104,"children":3105},{"style":738},[3106],{"type":612,"value":772},{"type":606,"tag":636,"props":3108,"children":3109},{"style":754},[3110],{"type":612,"value":777},{"type":606,"tag":636,"props":3112,"children":3113},{"style":648},[3114],{"type":612,"value":782},{"type":606,"tag":636,"props":3116,"children":3117},{"class":638,"line":272},[3118],{"type":606,"tag":636,"props":3119,"children":3120},{"emptyLinePlaceholder":13},[3121],{"type":612,"value":681},{"type":606,"tag":636,"props":3123,"children":3124},{"class":638,"line":281},[3125],{"type":606,"tag":636,"props":3126,"children":3127},{"style":687},[3128],{"type":612,"value":3129},"# Test timestamp validation\n",{"type":606,"tag":636,"props":3131,"children":3132},{"class":638,"line":291},[3133,3138,3142],{"type":606,"tag":636,"props":3134,"children":3135},{"style":648},[3136],{"type":612,"value":3137},"test_timestamps ",{"type":606,"tag":636,"props":3139,"children":3140},{"style":642},[3141],{"type":612,"value":703},{"type":606,"tag":636,"props":3143,"children":3144},{"style":648},[3145],{"type":612,"value":3146}," [\n",{"type":606,"tag":636,"props":3148,"children":3149},{"class":638,"line":302},[3150,3155],{"type":606,"tag":636,"props":3151,"children":3152},{"style":648},[3153],{"type":612,"value":3154},"    time.time(),           ",{"type":606,"tag":636,"props":3156,"children":3157},{"style":687},[3158],{"type":612,"value":3159},"# Valid current time\n",{"type":606,"tag":636,"props":3161,"children":3162},{"class":638,"line":311},[3163,3168,3173],{"type":606,"tag":636,"props":3164,"children":3165},{"style":738},[3166],{"type":612,"value":3167},"    1234567890",{"type":606,"tag":636,"props":3169,"children":3170},{"style":648},[3171],{"type":612,"value":3172},",           ",{"type":606,"tag":636,"props":3174,"children":3175},{"style":687},[3176],{"type":612,"value":3177},"# Valid past time (2009)\n",{"type":606,"tag":636,"props":3179,"children":3180},{"class":638,"line":320},[3181,3186,3191],{"type":606,"tag":636,"props":3182,"children":3183},{"style":738},[3184],{"type":612,"value":3185},"    12345",{"type":606,"tag":636,"props":3187,"children":3188},{"style":648},[3189],{"type":612,"value":3190},",                ",{"type":606,"tag":636,"props":3192,"children":3193},{"style":687},[3194],{"type":612,"value":3195},"# Invalid (too early)\n",{"type":606,"tag":636,"props":3197,"children":3198},{"class":638,"line":329},[3199,3204,3208],{"type":606,"tag":636,"props":3200,"children":3201},{"style":738},[3202],{"type":612,"value":3203},"    9999999999",{"type":606,"tag":636,"props":3205,"children":3206},{"style":648},[3207],{"type":612,"value":3172},{"type":606,"tag":636,"props":3209,"children":3210},{"style":687},[3211],{"type":612,"value":3212},"# Invalid (too late for 32-bit)\n",{"type":606,"tag":636,"props":3214,"children":3215},{"class":638,"line":338},[3216],{"type":606,"tag":636,"props":3217,"children":3218},{"style":648},[3219],{"type":612,"value":3220},"]\n",{"type":606,"tag":636,"props":3222,"children":3223},{"class":638,"line":347},[3224],{"type":606,"tag":636,"props":3225,"children":3226},{"emptyLinePlaceholder":13},[3227],{"type":612,"value":681},{"type":606,"tag":636,"props":3229,"children":3230},{"class":638,"line":356},[3231,3236,3241,3246],{"type":606,"tag":636,"props":3232,"children":3233},{"style":642},[3234],{"type":612,"value":3235},"for",{"type":606,"tag":636,"props":3237,"children":3238},{"style":648},[3239],{"type":612,"value":3240}," ts ",{"type":606,"tag":636,"props":3242,"children":3243},{"style":642},[3244],{"type":612,"value":3245},"in",{"type":606,"tag":636,"props":3247,"children":3248},{"style":648},[3249],{"type":612,"value":3250}," test_timestamps:\n",{"type":606,"tag":636,"props":3252,"children":3253},{"class":638,"line":367},[3254,3259,3263],{"type":606,"tag":636,"props":3255,"children":3256},{"style":648},[3257],{"type":612,"value":3258},"    valid ",{"type":606,"tag":636,"props":3260,"children":3261},{"style":642},[3262],{"type":612,"value":703},{"type":606,"tag":636,"props":3264,"children":3265},{"style":648},[3266],{"type":612,"value":3267}," is_valid_timestamp(ts)\n",{"type":606,"tag":636,"props":3269,"children":3270},{"class":638,"line":376},[3271,3275],{"type":606,"tag":636,"props":3272,"children":3273},{"style":642},[3274],{"type":612,"value":2775},{"type":606,"tag":636,"props":3276,"children":3277},{"style":648},[3278],{"type":612,"value":3279}," valid:\n",{"type":606,"tag":636,"props":3281,"children":3282},{"class":638,"line":385},[3283,3287,3291],{"type":606,"tag":636,"props":3284,"children":3285},{"style":648},[3286],{"type":612,"value":2958},{"type":606,"tag":636,"props":3288,"children":3289},{"style":642},[3290],{"type":612,"value":703},{"type":606,"tag":636,"props":3292,"children":3293},{"style":648},[3294],{"type":612,"value":3295}," timestamp_to_datetime(ts)\n",{"type":606,"tag":636,"props":3297,"children":3298},{"class":638,"line":394},[3299,3304,3308,3312,3317,3321,3326,3330,3335,3339,3343,3347,3351],{"type":606,"tag":636,"props":3300,"children":3301},{"style":738},[3302],{"type":612,"value":3303},"        print",{"type":606,"tag":636,"props":3305,"children":3306},{"style":648},[3307],{"type":612,"value":746},{"type":606,"tag":636,"props":3309,"children":3310},{"style":642},[3311],{"type":612,"value":751},{"type":606,"tag":636,"props":3313,"children":3314},{"style":754},[3315],{"type":612,"value":3316},"\"✓ ",{"type":606,"tag":636,"props":3318,"children":3319},{"style":738},[3320],{"type":612,"value":762},{"type":606,"tag":636,"props":3322,"children":3323},{"style":648},[3324],{"type":612,"value":3325},"ts",{"type":606,"tag":636,"props":3327,"children":3328},{"style":738},[3329],{"type":612,"value":772},{"type":606,"tag":636,"props":3331,"children":3332},{"style":754},[3333],{"type":612,"value":3334}," → ",{"type":606,"tag":636,"props":3336,"children":3337},{"style":738},[3338],{"type":612,"value":762},{"type":606,"tag":636,"props":3340,"children":3341},{"style":648},[3342],{"type":612,"value":1030},{"type":606,"tag":636,"props":3344,"children":3345},{"style":738},[3346],{"type":612,"value":772},{"type":606,"tag":636,"props":3348,"children":3349},{"style":754},[3350],{"type":612,"value":777},{"type":606,"tag":636,"props":3352,"children":3353},{"style":648},[3354],{"type":612,"value":782},{"type":606,"tag":636,"props":3356,"children":3357},{"class":638,"line":403},[3358,3363],{"type":606,"tag":636,"props":3359,"children":3360},{"style":642},[3361],{"type":612,"value":3362},"    else",{"type":606,"tag":636,"props":3364,"children":3365},{"style":648},[3366],{"type":612,"value":2950},{"type":606,"tag":636,"props":3368,"children":3369},{"class":638,"line":412},[3370,3374,3378,3382,3387,3391,3395,3399,3404],{"type":606,"tag":636,"props":3371,"children":3372},{"style":738},[3373],{"type":612,"value":3303},{"type":606,"tag":636,"props":3375,"children":3376},{"style":648},[3377],{"type":612,"value":746},{"type":606,"tag":636,"props":3379,"children":3380},{"style":642},[3381],{"type":612,"value":751},{"type":606,"tag":636,"props":3383,"children":3384},{"style":754},[3385],{"type":612,"value":3386},"\"✗ ",{"type":606,"tag":636,"props":3388,"children":3389},{"style":738},[3390],{"type":612,"value":762},{"type":606,"tag":636,"props":3392,"children":3393},{"style":648},[3394],{"type":612,"value":3325},{"type":606,"tag":636,"props":3396,"children":3397},{"style":738},[3398],{"type":612,"value":772},{"type":606,"tag":636,"props":3400,"children":3401},{"style":754},[3402],{"type":612,"value":3403}," → Invalid timestamp\"",{"type":606,"tag":636,"props":3405,"children":3406},{"style":648},[3407],{"type":612,"value":782},{"type":606,"tag":1166,"props":3409,"children":3411},{"id":3410},"performance-timing",[3412],{"type":612,"value":3413},"Performance Timing",{"type":606,"tag":621,"props":3415,"children":3416},{},[3417],{"type":606,"tag":625,"props":3418,"children":3420},{"className":627,"code":3419,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime\n\nclass Timer:\n    \"\"\"Simple performance timer using timestamps\"\"\"\n    \n    def __init__(self):\n        self.start_time = None\n        self.end_time = None\n    \n    def start(self):\n        \"\"\"Start timing\"\"\"\n        self.start_time = time.time()\n        print(f\"Timer started at: {datetime.fromtimestamp(self.start_time)}\")\n    \n    def stop(self):\n        \"\"\"Stop timing and return duration\"\"\"\n        self.end_time = time.time()\n        duration = self.end_time - self.start_time\n        print(f\"Timer stopped at: {datetime.fromtimestamp(self.end_time)}\")\n        print(f\"Duration: {duration:.6f} seconds\")\n        return duration\n    \n    def lap(self):\n        \"\"\"Get current duration without stopping\"\"\"\n        if self.start_time is None:\n            return 0\n        current_time = time.time()\n        return current_time - self.start_time\n\n# Example usage\ntimer = Timer()\ntimer.start()\n\n# Simulate some work\ntime.sleep(0.1)\nlap_time = timer.lap()\nprint(f\"Lap time: {lap_time:.3f} seconds\")\n\ntime.sleep(0.1)\ntotal_time = timer.stop()\n",[3421],{"type":606,"tag":632,"props":3422,"children":3423},{"__ignoreMap":8},[3424,3435,3454,3461,3478,3486,3494,3512,3534,3554,3561,3577,3585,3604,3655,3662,3678,3686,3705,3740,3789,3835,3847,3854,3870,3878,3908,3921,3937,3961,3968,3975,3992,4000,4007,4015,4032,4049,4095,4102,4117],{"type":606,"tag":636,"props":3425,"children":3426},{"class":638,"line":12},[3427,3431],{"type":606,"tag":636,"props":3428,"children":3429},{"style":642},[3430],{"type":612,"value":645},{"type":606,"tag":636,"props":3432,"children":3433},{"style":648},[3434],{"type":612,"value":651},{"type":606,"tag":636,"props":3436,"children":3437},{"class":638,"line":27},[3438,3442,3446,3450],{"type":606,"tag":636,"props":3439,"children":3440},{"style":642},[3441],{"type":612,"value":659},{"type":606,"tag":636,"props":3443,"children":3444},{"style":648},[3445],{"type":612,"value":664},{"type":606,"tag":636,"props":3447,"children":3448},{"style":642},[3449],{"type":612,"value":645},{"type":606,"tag":636,"props":3451,"children":3452},{"style":648},[3453],{"type":612,"value":673},{"type":606,"tag":636,"props":3455,"children":3456},{"class":638,"line":36},[3457],{"type":606,"tag":636,"props":3458,"children":3459},{"emptyLinePlaceholder":13},[3460],{"type":612,"value":681},{"type":606,"tag":636,"props":3462,"children":3463},{"class":638,"line":45},[3464,3469,3474],{"type":606,"tag":636,"props":3465,"children":3466},{"style":642},[3467],{"type":612,"value":3468},"class",{"type":606,"tag":636,"props":3470,"children":3471},{"style":2676},[3472],{"type":612,"value":3473}," Timer",{"type":606,"tag":636,"props":3475,"children":3476},{"style":648},[3477],{"type":612,"value":2950},{"type":606,"tag":636,"props":3479,"children":3480},{"class":638,"line":54},[3481],{"type":606,"tag":636,"props":3482,"children":3483},{"style":754},[3484],{"type":612,"value":3485},"    \"\"\"Simple performance timer using timestamps\"\"\"\n",{"type":606,"tag":636,"props":3487,"children":3488},{"class":638,"line":63},[3489],{"type":606,"tag":636,"props":3490,"children":3491},{"style":648},[3492],{"type":612,"value":3493},"    \n",{"type":606,"tag":636,"props":3495,"children":3496},{"class":638,"line":72},[3497,3502,3507],{"type":606,"tag":636,"props":3498,"children":3499},{"style":642},[3500],{"type":612,"value":3501},"    def",{"type":606,"tag":636,"props":3503,"children":3504},{"style":738},[3505],{"type":612,"value":3506}," __init__",{"type":606,"tag":636,"props":3508,"children":3509},{"style":648},[3510],{"type":612,"value":3511},"(self):\n",{"type":606,"tag":636,"props":3513,"children":3514},{"class":638,"line":81},[3515,3520,3525,3529],{"type":606,"tag":636,"props":3516,"children":3517},{"style":738},[3518],{"type":612,"value":3519},"        self",{"type":606,"tag":636,"props":3521,"children":3522},{"style":648},[3523],{"type":612,"value":3524},".start_time ",{"type":606,"tag":636,"props":3526,"children":3527},{"style":642},[3528],{"type":612,"value":703},{"type":606,"tag":636,"props":3530,"children":3531},{"style":738},[3532],{"type":612,"value":3533}," None\n",{"type":606,"tag":636,"props":3535,"children":3536},{"class":638,"line":785},[3537,3541,3546,3550],{"type":606,"tag":636,"props":3538,"children":3539},{"style":738},[3540],{"type":612,"value":3519},{"type":606,"tag":636,"props":3542,"children":3543},{"style":648},[3544],{"type":612,"value":3545},".end_time ",{"type":606,"tag":636,"props":3547,"children":3548},{"style":642},[3549],{"type":612,"value":703},{"type":606,"tag":636,"props":3551,"children":3552},{"style":738},[3553],{"type":612,"value":3533},{"type":606,"tag":636,"props":3555,"children":3556},{"class":638,"line":99},[3557],{"type":606,"tag":636,"props":3558,"children":3559},{"style":648},[3560],{"type":612,"value":3493},{"type":606,"tag":636,"props":3562,"children":3563},{"class":638,"line":108},[3564,3568,3573],{"type":606,"tag":636,"props":3565,"children":3566},{"style":642},[3567],{"type":612,"value":3501},{"type":606,"tag":636,"props":3569,"children":3570},{"style":2676},[3571],{"type":612,"value":3572}," start",{"type":606,"tag":636,"props":3574,"children":3575},{"style":648},[3576],{"type":612,"value":3511},{"type":606,"tag":636,"props":3578,"children":3579},{"class":638,"line":117},[3580],{"type":606,"tag":636,"props":3581,"children":3582},{"style":754},[3583],{"type":612,"value":3584},"        \"\"\"Start timing\"\"\"\n",{"type":606,"tag":636,"props":3586,"children":3587},{"class":638,"line":126},[3588,3592,3596,3600],{"type":606,"tag":636,"props":3589,"children":3590},{"style":738},[3591],{"type":612,"value":3519},{"type":606,"tag":636,"props":3593,"children":3594},{"style":648},[3595],{"type":612,"value":3524},{"type":606,"tag":636,"props":3597,"children":3598},{"style":642},[3599],{"type":612,"value":703},{"type":606,"tag":636,"props":3601,"children":3602},{"style":648},[3603],{"type":612,"value":708},{"type":606,"tag":636,"props":3605,"children":3606},{"class":638,"line":135},[3607,3611,3615,3619,3624,3628,3633,3638,3643,3647,3651],{"type":606,"tag":636,"props":3608,"children":3609},{"style":738},[3610],{"type":612,"value":3303},{"type":606,"tag":636,"props":3612,"children":3613},{"style":648},[3614],{"type":612,"value":746},{"type":606,"tag":636,"props":3616,"children":3617},{"style":642},[3618],{"type":612,"value":751},{"type":606,"tag":636,"props":3620,"children":3621},{"style":754},[3622],{"type":612,"value":3623},"\"Timer started at: ",{"type":606,"tag":636,"props":3625,"children":3626},{"style":738},[3627],{"type":612,"value":762},{"type":606,"tag":636,"props":3629,"children":3630},{"style":648},[3631],{"type":612,"value":3632},"datetime.fromtimestamp(",{"type":606,"tag":636,"props":3634,"children":3635},{"style":738},[3636],{"type":612,"value":3637},"self",{"type":606,"tag":636,"props":3639,"children":3640},{"style":648},[3641],{"type":612,"value":3642},".start_time)",{"type":606,"tag":636,"props":3644,"children":3645},{"style":738},[3646],{"type":612,"value":772},{"type":606,"tag":636,"props":3648,"children":3649},{"style":754},[3650],{"type":612,"value":777},{"type":606,"tag":636,"props":3652,"children":3653},{"style":648},[3654],{"type":612,"value":782},{"type":606,"tag":636,"props":3656,"children":3657},{"class":638,"line":144},[3658],{"type":606,"tag":636,"props":3659,"children":3660},{"style":648},[3661],{"type":612,"value":3493},{"type":606,"tag":636,"props":3663,"children":3664},{"class":638,"line":153},[3665,3669,3674],{"type":606,"tag":636,"props":3666,"children":3667},{"style":642},[3668],{"type":612,"value":3501},{"type":606,"tag":636,"props":3670,"children":3671},{"style":2676},[3672],{"type":612,"value":3673}," stop",{"type":606,"tag":636,"props":3675,"children":3676},{"style":648},[3677],{"type":612,"value":3511},{"type":606,"tag":636,"props":3679,"children":3680},{"class":638,"line":163},[3681],{"type":606,"tag":636,"props":3682,"children":3683},{"style":754},[3684],{"type":612,"value":3685},"        \"\"\"Stop timing and return duration\"\"\"\n",{"type":606,"tag":636,"props":3687,"children":3688},{"class":638,"line":172},[3689,3693,3697,3701],{"type":606,"tag":636,"props":3690,"children":3691},{"style":738},[3692],{"type":612,"value":3519},{"type":606,"tag":636,"props":3694,"children":3695},{"style":648},[3696],{"type":612,"value":3545},{"type":606,"tag":636,"props":3698,"children":3699},{"style":642},[3700],{"type":612,"value":703},{"type":606,"tag":636,"props":3702,"children":3703},{"style":648},[3704],{"type":612,"value":708},{"type":606,"tag":636,"props":3706,"children":3707},{"class":638,"line":181},[3708,3713,3717,3722,3726,3731,3735],{"type":606,"tag":636,"props":3709,"children":3710},{"style":648},[3711],{"type":612,"value":3712},"        duration ",{"type":606,"tag":636,"props":3714,"children":3715},{"style":642},[3716],{"type":612,"value":703},{"type":606,"tag":636,"props":3718,"children":3719},{"style":738},[3720],{"type":612,"value":3721}," self",{"type":606,"tag":636,"props":3723,"children":3724},{"style":648},[3725],{"type":612,"value":3545},{"type":606,"tag":636,"props":3727,"children":3728},{"style":642},[3729],{"type":612,"value":3730},"-",{"type":606,"tag":636,"props":3732,"children":3733},{"style":738},[3734],{"type":612,"value":3721},{"type":606,"tag":636,"props":3736,"children":3737},{"style":648},[3738],{"type":612,"value":3739},".start_time\n",{"type":606,"tag":636,"props":3741,"children":3742},{"class":638,"line":190},[3743,3747,3751,3755,3760,3764,3768,3772,3777,3781,3785],{"type":606,"tag":636,"props":3744,"children":3745},{"style":738},[3746],{"type":612,"value":3303},{"type":606,"tag":636,"props":3748,"children":3749},{"style":648},[3750],{"type":612,"value":746},{"type":606,"tag":636,"props":3752,"children":3753},{"style":642},[3754],{"type":612,"value":751},{"type":606,"tag":636,"props":3756,"children":3757},{"style":754},[3758],{"type":612,"value":3759},"\"Timer stopped at: ",{"type":606,"tag":636,"props":3761,"children":3762},{"style":738},[3763],{"type":612,"value":762},{"type":606,"tag":636,"props":3765,"children":3766},{"style":648},[3767],{"type":612,"value":3632},{"type":606,"tag":636,"props":3769,"children":3770},{"style":738},[3771],{"type":612,"value":3637},{"type":606,"tag":636,"props":3773,"children":3774},{"style":648},[3775],{"type":612,"value":3776},".end_time)",{"type":606,"tag":636,"props":3778,"children":3779},{"style":738},[3780],{"type":612,"value":772},{"type":606,"tag":636,"props":3782,"children":3783},{"style":754},[3784],{"type":612,"value":777},{"type":606,"tag":636,"props":3786,"children":3787},{"style":648},[3788],{"type":612,"value":782},{"type":606,"tag":636,"props":3790,"children":3791},{"class":638,"line":199},[3792,3796,3800,3804,3809,3813,3818,3822,3826,3831],{"type":606,"tag":636,"props":3793,"children":3794},{"style":738},[3795],{"type":612,"value":3303},{"type":606,"tag":636,"props":3797,"children":3798},{"style":648},[3799],{"type":612,"value":746},{"type":606,"tag":636,"props":3801,"children":3802},{"style":642},[3803],{"type":612,"value":751},{"type":606,"tag":636,"props":3805,"children":3806},{"style":754},[3807],{"type":612,"value":3808},"\"Duration: ",{"type":606,"tag":636,"props":3810,"children":3811},{"style":738},[3812],{"type":612,"value":762},{"type":606,"tag":636,"props":3814,"children":3815},{"style":648},[3816],{"type":612,"value":3817},"duration",{"type":606,"tag":636,"props":3819,"children":3820},{"style":642},[3821],{"type":612,"value":1310},{"type":606,"tag":636,"props":3823,"children":3824},{"style":738},[3825],{"type":612,"value":772},{"type":606,"tag":636,"props":3827,"children":3828},{"style":754},[3829],{"type":612,"value":3830}," seconds\"",{"type":606,"tag":636,"props":3832,"children":3833},{"style":648},[3834],{"type":612,"value":782},{"type":606,"tag":636,"props":3836,"children":3837},{"class":638,"line":208},[3838,3842],{"type":606,"tag":636,"props":3839,"children":3840},{"style":642},[3841],{"type":612,"value":2974},{"type":606,"tag":636,"props":3843,"children":3844},{"style":648},[3845],{"type":612,"value":3846}," duration\n",{"type":606,"tag":636,"props":3848,"children":3849},{"class":638,"line":217},[3850],{"type":606,"tag":636,"props":3851,"children":3852},{"style":648},[3853],{"type":612,"value":3493},{"type":606,"tag":636,"props":3855,"children":3856},{"class":638,"line":227},[3857,3861,3866],{"type":606,"tag":636,"props":3858,"children":3859},{"style":642},[3860],{"type":612,"value":3501},{"type":606,"tag":636,"props":3862,"children":3863},{"style":2676},[3864],{"type":612,"value":3865}," lap",{"type":606,"tag":636,"props":3867,"children":3868},{"style":648},[3869],{"type":612,"value":3511},{"type":606,"tag":636,"props":3871,"children":3872},{"class":638,"line":236},[3873],{"type":606,"tag":636,"props":3874,"children":3875},{"style":754},[3876],{"type":612,"value":3877},"        \"\"\"Get current duration without stopping\"\"\"\n",{"type":606,"tag":636,"props":3879,"children":3880},{"class":638,"line":245},[3881,3886,3890,3894,3899,3904],{"type":606,"tag":636,"props":3882,"children":3883},{"style":642},[3884],{"type":612,"value":3885},"        if",{"type":606,"tag":636,"props":3887,"children":3888},{"style":738},[3889],{"type":612,"value":3721},{"type":606,"tag":636,"props":3891,"children":3892},{"style":648},[3893],{"type":612,"value":3524},{"type":606,"tag":636,"props":3895,"children":3896},{"style":642},[3897],{"type":612,"value":3898},"is",{"type":606,"tag":636,"props":3900,"children":3901},{"style":738},[3902],{"type":612,"value":3903}," None",{"type":606,"tag":636,"props":3905,"children":3906},{"style":648},[3907],{"type":612,"value":2950},{"type":606,"tag":636,"props":3909,"children":3910},{"class":638,"line":254},[3911,3916],{"type":606,"tag":636,"props":3912,"children":3913},{"style":642},[3914],{"type":612,"value":3915},"            return",{"type":606,"tag":636,"props":3917,"children":3918},{"style":738},[3919],{"type":612,"value":3920}," 0\n",{"type":606,"tag":636,"props":3922,"children":3923},{"class":638,"line":263},[3924,3929,3933],{"type":606,"tag":636,"props":3925,"children":3926},{"style":648},[3927],{"type":612,"value":3928},"        current_time ",{"type":606,"tag":636,"props":3930,"children":3931},{"style":642},[3932],{"type":612,"value":703},{"type":606,"tag":636,"props":3934,"children":3935},{"style":648},[3936],{"type":612,"value":708},{"type":606,"tag":636,"props":3938,"children":3939},{"class":638,"line":272},[3940,3944,3949,3953,3957],{"type":606,"tag":636,"props":3941,"children":3942},{"style":642},[3943],{"type":612,"value":2974},{"type":606,"tag":636,"props":3945,"children":3946},{"style":648},[3947],{"type":612,"value":3948}," current_time ",{"type":606,"tag":636,"props":3950,"children":3951},{"style":642},[3952],{"type":612,"value":3730},{"type":606,"tag":636,"props":3954,"children":3955},{"style":738},[3956],{"type":612,"value":3721},{"type":606,"tag":636,"props":3958,"children":3959},{"style":648},[3960],{"type":612,"value":3739},{"type":606,"tag":636,"props":3962,"children":3963},{"class":638,"line":281},[3964],{"type":606,"tag":636,"props":3965,"children":3966},{"emptyLinePlaceholder":13},[3967],{"type":612,"value":681},{"type":606,"tag":636,"props":3969,"children":3970},{"class":638,"line":291},[3971],{"type":606,"tag":636,"props":3972,"children":3973},{"style":687},[3974],{"type":612,"value":3056},{"type":606,"tag":636,"props":3976,"children":3977},{"class":638,"line":302},[3978,3983,3987],{"type":606,"tag":636,"props":3979,"children":3980},{"style":648},[3981],{"type":612,"value":3982},"timer ",{"type":606,"tag":636,"props":3984,"children":3985},{"style":642},[3986],{"type":612,"value":703},{"type":606,"tag":636,"props":3988,"children":3989},{"style":648},[3990],{"type":612,"value":3991}," Timer()\n",{"type":606,"tag":636,"props":3993,"children":3994},{"class":638,"line":311},[3995],{"type":606,"tag":636,"props":3996,"children":3997},{"style":648},[3998],{"type":612,"value":3999},"timer.start()\n",{"type":606,"tag":636,"props":4001,"children":4002},{"class":638,"line":320},[4003],{"type":606,"tag":636,"props":4004,"children":4005},{"emptyLinePlaceholder":13},[4006],{"type":612,"value":681},{"type":606,"tag":636,"props":4008,"children":4009},{"class":638,"line":329},[4010],{"type":606,"tag":636,"props":4011,"children":4012},{"style":687},[4013],{"type":612,"value":4014},"# Simulate some work\n",{"type":606,"tag":636,"props":4016,"children":4017},{"class":638,"line":338},[4018,4023,4028],{"type":606,"tag":636,"props":4019,"children":4020},{"style":648},[4021],{"type":612,"value":4022},"time.sleep(",{"type":606,"tag":636,"props":4024,"children":4025},{"style":738},[4026],{"type":612,"value":4027},"0.1",{"type":606,"tag":636,"props":4029,"children":4030},{"style":648},[4031],{"type":612,"value":782},{"type":606,"tag":636,"props":4033,"children":4034},{"class":638,"line":347},[4035,4040,4044],{"type":606,"tag":636,"props":4036,"children":4037},{"style":648},[4038],{"type":612,"value":4039},"lap_time ",{"type":606,"tag":636,"props":4041,"children":4042},{"style":642},[4043],{"type":612,"value":703},{"type":606,"tag":636,"props":4045,"children":4046},{"style":648},[4047],{"type":612,"value":4048}," timer.lap()\n",{"type":606,"tag":636,"props":4050,"children":4051},{"class":638,"line":356},[4052,4056,4060,4064,4069,4073,4078,4083,4087,4091],{"type":606,"tag":636,"props":4053,"children":4054},{"style":738},[4055],{"type":612,"value":741},{"type":606,"tag":636,"props":4057,"children":4058},{"style":648},[4059],{"type":612,"value":746},{"type":606,"tag":636,"props":4061,"children":4062},{"style":642},[4063],{"type":612,"value":751},{"type":606,"tag":636,"props":4065,"children":4066},{"style":754},[4067],{"type":612,"value":4068},"\"Lap time: ",{"type":606,"tag":636,"props":4070,"children":4071},{"style":738},[4072],{"type":612,"value":762},{"type":606,"tag":636,"props":4074,"children":4075},{"style":648},[4076],{"type":612,"value":4077},"lap_time",{"type":606,"tag":636,"props":4079,"children":4080},{"style":642},[4081],{"type":612,"value":4082},":.3f",{"type":606,"tag":636,"props":4084,"children":4085},{"style":738},[4086],{"type":612,"value":772},{"type":606,"tag":636,"props":4088,"children":4089},{"style":754},[4090],{"type":612,"value":3830},{"type":606,"tag":636,"props":4092,"children":4093},{"style":648},[4094],{"type":612,"value":782},{"type":606,"tag":636,"props":4096,"children":4097},{"class":638,"line":367},[4098],{"type":606,"tag":636,"props":4099,"children":4100},{"emptyLinePlaceholder":13},[4101],{"type":612,"value":681},{"type":606,"tag":636,"props":4103,"children":4104},{"class":638,"line":376},[4105,4109,4113],{"type":606,"tag":636,"props":4106,"children":4107},{"style":648},[4108],{"type":612,"value":4022},{"type":606,"tag":636,"props":4110,"children":4111},{"style":738},[4112],{"type":612,"value":4027},{"type":606,"tag":636,"props":4114,"children":4115},{"style":648},[4116],{"type":612,"value":782},{"type":606,"tag":636,"props":4118,"children":4119},{"class":638,"line":385},[4120,4125,4129],{"type":606,"tag":636,"props":4121,"children":4122},{"style":648},[4123],{"type":612,"value":4124},"total_time ",{"type":606,"tag":636,"props":4126,"children":4127},{"style":642},[4128],{"type":612,"value":703},{"type":606,"tag":636,"props":4130,"children":4131},{"style":648},[4132],{"type":612,"value":4133}," timer.stop()\n",{"type":606,"tag":1166,"props":4135,"children":4137},{"id":4136},"data-timestamping",[4138],{"type":612,"value":4139},"Data Timestamping",{"type":606,"tag":621,"props":4141,"children":4142},{},[4143],{"type":606,"tag":625,"props":4144,"children":4146},{"className":627,"code":4145,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime\nimport json\n\nclass TimestampedData:\n    \"\"\"Add timestamps to data for tracking\"\"\"\n    \n    def __init__(self):\n        self.data = []\n    \n    def add_entry(self, data, custom_timestamp=None):\n        \"\"\"Add data entry with timestamp\"\"\"\n        timestamp = custom_timestamp or time.time()\n        entry = {\n            'timestamp': timestamp,\n            'datetime': datetime.fromtimestamp(timestamp).isoformat(),\n            'data': data\n        }\n        self.data.append(entry)\n        return entry\n    \n    def get_entries_between(self, start_time, end_time):\n        \"\"\"Get entries between two timestamps\"\"\"\n        return [\n            entry for entry in self.data\n            if start_time \u003C= entry['timestamp'] \u003C= end_time\n        ]\n    \n    def get_recent_entries(self, seconds=3600):\n        \"\"\"Get entries from last N seconds\"\"\"\n        cutoff = time.time() - seconds\n        return [\n            entry for entry in self.data\n            if entry['timestamp'] >= cutoff\n        ]\n    \n    def to_json(self):\n        \"\"\"Export data as JSON\"\"\"\n        return json.dumps(self.data, indent=2)\n\n# Example usage\nlogger = TimestampedData()\n\n# Add some sample data\nlogger.add_entry({\"temperature\": 22.5, \"humidity\": 65})\ntime.sleep(0.1)\nlogger.add_entry({\"temperature\": 23.1, \"humidity\": 63})\ntime.sleep(0.1)\nlogger.add_entry({\"temperature\": 22.8, \"humidity\": 64})\n\n# Get recent entries\nrecent = logger.get_recent_entries(seconds=1)\nprint(f\"Recent entries: {len(recent)}\")\n\n# Print formatted data\nfor entry in logger.data:\n    dt = datetime.fromtimestamp(entry['timestamp'])\n    print(f\"{dt.strftime('%H:%M:%S')}: {entry['data']}\")\n",[4147],{"type":606,"tag":632,"props":4148,"children":4149},{"__ignoreMap":8},[4150,4161,4180,4192,4199,4215,4223,4230,4245,4266,4273,4303,4311,4336,4353,4366,4379,4392,4400,4412,4424,4431,4448,4456,4467,4497,4538,4546,4553,4583,4591,4617,4628,4655,4684,4691,4698,4714,4722,4761,4768,4775,4792,4799,4807,4853,4868,4909,4924,4965,4972,4980,5014,5056,5063,5071,5091,5117],{"type":606,"tag":636,"props":4151,"children":4152},{"class":638,"line":12},[4153,4157],{"type":606,"tag":636,"props":4154,"children":4155},{"style":642},[4156],{"type":612,"value":645},{"type":606,"tag":636,"props":4158,"children":4159},{"style":648},[4160],{"type":612,"value":651},{"type":606,"tag":636,"props":4162,"children":4163},{"class":638,"line":27},[4164,4168,4172,4176],{"type":606,"tag":636,"props":4165,"children":4166},{"style":642},[4167],{"type":612,"value":659},{"type":606,"tag":636,"props":4169,"children":4170},{"style":648},[4171],{"type":612,"value":664},{"type":606,"tag":636,"props":4173,"children":4174},{"style":642},[4175],{"type":612,"value":645},{"type":606,"tag":636,"props":4177,"children":4178},{"style":648},[4179],{"type":612,"value":673},{"type":606,"tag":636,"props":4181,"children":4182},{"class":638,"line":36},[4183,4187],{"type":606,"tag":636,"props":4184,"children":4185},{"style":642},[4186],{"type":612,"value":645},{"type":606,"tag":636,"props":4188,"children":4189},{"style":648},[4190],{"type":612,"value":4191}," json\n",{"type":606,"tag":636,"props":4193,"children":4194},{"class":638,"line":45},[4195],{"type":606,"tag":636,"props":4196,"children":4197},{"emptyLinePlaceholder":13},[4198],{"type":612,"value":681},{"type":606,"tag":636,"props":4200,"children":4201},{"class":638,"line":54},[4202,4206,4211],{"type":606,"tag":636,"props":4203,"children":4204},{"style":642},[4205],{"type":612,"value":3468},{"type":606,"tag":636,"props":4207,"children":4208},{"style":2676},[4209],{"type":612,"value":4210}," TimestampedData",{"type":606,"tag":636,"props":4212,"children":4213},{"style":648},[4214],{"type":612,"value":2950},{"type":606,"tag":636,"props":4216,"children":4217},{"class":638,"line":63},[4218],{"type":606,"tag":636,"props":4219,"children":4220},{"style":754},[4221],{"type":612,"value":4222},"    \"\"\"Add timestamps to data for tracking\"\"\"\n",{"type":606,"tag":636,"props":4224,"children":4225},{"class":638,"line":72},[4226],{"type":606,"tag":636,"props":4227,"children":4228},{"style":648},[4229],{"type":612,"value":3493},{"type":606,"tag":636,"props":4231,"children":4232},{"class":638,"line":81},[4233,4237,4241],{"type":606,"tag":636,"props":4234,"children":4235},{"style":642},[4236],{"type":612,"value":3501},{"type":606,"tag":636,"props":4238,"children":4239},{"style":738},[4240],{"type":612,"value":3506},{"type":606,"tag":636,"props":4242,"children":4243},{"style":648},[4244],{"type":612,"value":3511},{"type":606,"tag":636,"props":4246,"children":4247},{"class":638,"line":785},[4248,4252,4257,4261],{"type":606,"tag":636,"props":4249,"children":4250},{"style":738},[4251],{"type":612,"value":3519},{"type":606,"tag":636,"props":4253,"children":4254},{"style":648},[4255],{"type":612,"value":4256},".data ",{"type":606,"tag":636,"props":4258,"children":4259},{"style":642},[4260],{"type":612,"value":703},{"type":606,"tag":636,"props":4262,"children":4263},{"style":648},[4264],{"type":612,"value":4265}," []\n",{"type":606,"tag":636,"props":4267,"children":4268},{"class":638,"line":99},[4269],{"type":606,"tag":636,"props":4270,"children":4271},{"style":648},[4272],{"type":612,"value":3493},{"type":606,"tag":636,"props":4274,"children":4275},{"class":638,"line":108},[4276,4280,4285,4290,4294,4299],{"type":606,"tag":636,"props":4277,"children":4278},{"style":642},[4279],{"type":612,"value":3501},{"type":606,"tag":636,"props":4281,"children":4282},{"style":2676},[4283],{"type":612,"value":4284}," add_entry",{"type":606,"tag":636,"props":4286,"children":4287},{"style":648},[4288],{"type":612,"value":4289},"(self, data, custom_timestamp",{"type":606,"tag":636,"props":4291,"children":4292},{"style":642},[4293],{"type":612,"value":703},{"type":606,"tag":636,"props":4295,"children":4296},{"style":738},[4297],{"type":612,"value":4298},"None",{"type":606,"tag":636,"props":4300,"children":4301},{"style":648},[4302],{"type":612,"value":2759},{"type":606,"tag":636,"props":4304,"children":4305},{"class":638,"line":117},[4306],{"type":606,"tag":636,"props":4307,"children":4308},{"style":754},[4309],{"type":612,"value":4310},"        \"\"\"Add data entry with timestamp\"\"\"\n",{"type":606,"tag":636,"props":4312,"children":4313},{"class":638,"line":126},[4314,4318,4322,4327,4332],{"type":606,"tag":636,"props":4315,"children":4316},{"style":648},[4317],{"type":612,"value":2788},{"type":606,"tag":636,"props":4319,"children":4320},{"style":642},[4321],{"type":612,"value":703},{"type":606,"tag":636,"props":4323,"children":4324},{"style":648},[4325],{"type":612,"value":4326}," custom_timestamp ",{"type":606,"tag":636,"props":4328,"children":4329},{"style":642},[4330],{"type":612,"value":4331},"or",{"type":606,"tag":636,"props":4333,"children":4334},{"style":648},[4335],{"type":612,"value":708},{"type":606,"tag":636,"props":4337,"children":4338},{"class":638,"line":135},[4339,4344,4348],{"type":606,"tag":636,"props":4340,"children":4341},{"style":648},[4342],{"type":612,"value":4343},"        entry ",{"type":606,"tag":636,"props":4345,"children":4346},{"style":642},[4347],{"type":612,"value":703},{"type":606,"tag":636,"props":4349,"children":4350},{"style":648},[4351],{"type":612,"value":4352}," {\n",{"type":606,"tag":636,"props":4354,"children":4355},{"class":638,"line":144},[4356,4361],{"type":606,"tag":636,"props":4357,"children":4358},{"style":754},[4359],{"type":612,"value":4360},"            'timestamp'",{"type":606,"tag":636,"props":4362,"children":4363},{"style":648},[4364],{"type":612,"value":4365},": timestamp,\n",{"type":606,"tag":636,"props":4367,"children":4368},{"class":638,"line":153},[4369,4374],{"type":606,"tag":636,"props":4370,"children":4371},{"style":754},[4372],{"type":612,"value":4373},"            'datetime'",{"type":606,"tag":636,"props":4375,"children":4376},{"style":648},[4377],{"type":612,"value":4378},": datetime.fromtimestamp(timestamp).isoformat(),\n",{"type":606,"tag":636,"props":4380,"children":4381},{"class":638,"line":163},[4382,4387],{"type":606,"tag":636,"props":4383,"children":4384},{"style":754},[4385],{"type":612,"value":4386},"            'data'",{"type":606,"tag":636,"props":4388,"children":4389},{"style":648},[4390],{"type":612,"value":4391},": data\n",{"type":606,"tag":636,"props":4393,"children":4394},{"class":638,"line":172},[4395],{"type":606,"tag":636,"props":4396,"children":4397},{"style":648},[4398],{"type":612,"value":4399},"        }\n",{"type":606,"tag":636,"props":4401,"children":4402},{"class":638,"line":181},[4403,4407],{"type":606,"tag":636,"props":4404,"children":4405},{"style":738},[4406],{"type":612,"value":3519},{"type":606,"tag":636,"props":4408,"children":4409},{"style":648},[4410],{"type":612,"value":4411},".data.append(entry)\n",{"type":606,"tag":636,"props":4413,"children":4414},{"class":638,"line":190},[4415,4419],{"type":606,"tag":636,"props":4416,"children":4417},{"style":642},[4418],{"type":612,"value":2974},{"type":606,"tag":636,"props":4420,"children":4421},{"style":648},[4422],{"type":612,"value":4423}," entry\n",{"type":606,"tag":636,"props":4425,"children":4426},{"class":638,"line":199},[4427],{"type":606,"tag":636,"props":4428,"children":4429},{"style":648},[4430],{"type":612,"value":3493},{"type":606,"tag":636,"props":4432,"children":4433},{"class":638,"line":208},[4434,4438,4443],{"type":606,"tag":636,"props":4435,"children":4436},{"style":642},[4437],{"type":612,"value":3501},{"type":606,"tag":636,"props":4439,"children":4440},{"style":2676},[4441],{"type":612,"value":4442}," get_entries_between",{"type":606,"tag":636,"props":4444,"children":4445},{"style":648},[4446],{"type":612,"value":4447},"(self, start_time, end_time):\n",{"type":606,"tag":636,"props":4449,"children":4450},{"class":638,"line":217},[4451],{"type":606,"tag":636,"props":4452,"children":4453},{"style":754},[4454],{"type":612,"value":4455},"        \"\"\"Get entries between two timestamps\"\"\"\n",{"type":606,"tag":636,"props":4457,"children":4458},{"class":638,"line":227},[4459,4463],{"type":606,"tag":636,"props":4460,"children":4461},{"style":642},[4462],{"type":612,"value":2974},{"type":606,"tag":636,"props":4464,"children":4465},{"style":648},[4466],{"type":612,"value":3146},{"type":606,"tag":636,"props":4468,"children":4469},{"class":638,"line":236},[4470,4475,4479,4484,4488,4492],{"type":606,"tag":636,"props":4471,"children":4472},{"style":648},[4473],{"type":612,"value":4474},"            entry ",{"type":606,"tag":636,"props":4476,"children":4477},{"style":642},[4478],{"type":612,"value":3235},{"type":606,"tag":636,"props":4480,"children":4481},{"style":648},[4482],{"type":612,"value":4483}," entry ",{"type":606,"tag":636,"props":4485,"children":4486},{"style":642},[4487],{"type":612,"value":3245},{"type":606,"tag":636,"props":4489,"children":4490},{"style":738},[4491],{"type":612,"value":3721},{"type":606,"tag":636,"props":4493,"children":4494},{"style":648},[4495],{"type":612,"value":4496},".data\n",{"type":606,"tag":636,"props":4498,"children":4499},{"class":638,"line":245},[4500,4505,4510,4514,4519,4524,4529,4533],{"type":606,"tag":636,"props":4501,"children":4502},{"style":642},[4503],{"type":612,"value":4504},"            if",{"type":606,"tag":636,"props":4506,"children":4507},{"style":648},[4508],{"type":612,"value":4509}," start_time ",{"type":606,"tag":636,"props":4511,"children":4512},{"style":642},[4513],{"type":612,"value":2984},{"type":606,"tag":636,"props":4515,"children":4516},{"style":648},[4517],{"type":612,"value":4518}," entry[",{"type":606,"tag":636,"props":4520,"children":4521},{"style":754},[4522],{"type":612,"value":4523},"'timestamp'",{"type":606,"tag":636,"props":4525,"children":4526},{"style":648},[4527],{"type":612,"value":4528},"] ",{"type":606,"tag":636,"props":4530,"children":4531},{"style":642},[4532],{"type":612,"value":2984},{"type":606,"tag":636,"props":4534,"children":4535},{"style":648},[4536],{"type":612,"value":4537}," end_time\n",{"type":606,"tag":636,"props":4539,"children":4540},{"class":638,"line":254},[4541],{"type":606,"tag":636,"props":4542,"children":4543},{"style":648},[4544],{"type":612,"value":4545},"        ]\n",{"type":606,"tag":636,"props":4547,"children":4548},{"class":638,"line":263},[4549],{"type":606,"tag":636,"props":4550,"children":4551},{"style":648},[4552],{"type":612,"value":3493},{"type":606,"tag":636,"props":4554,"children":4555},{"class":638,"line":272},[4556,4560,4565,4570,4574,4579],{"type":606,"tag":636,"props":4557,"children":4558},{"style":642},[4559],{"type":612,"value":3501},{"type":606,"tag":636,"props":4561,"children":4562},{"style":2676},[4563],{"type":612,"value":4564}," get_recent_entries",{"type":606,"tag":636,"props":4566,"children":4567},{"style":648},[4568],{"type":612,"value":4569},"(self, seconds",{"type":606,"tag":636,"props":4571,"children":4572},{"style":642},[4573],{"type":612,"value":703},{"type":606,"tag":636,"props":4575,"children":4576},{"style":738},[4577],{"type":612,"value":4578},"3600",{"type":606,"tag":636,"props":4580,"children":4581},{"style":648},[4582],{"type":612,"value":2759},{"type":606,"tag":636,"props":4584,"children":4585},{"class":638,"line":281},[4586],{"type":606,"tag":636,"props":4587,"children":4588},{"style":754},[4589],{"type":612,"value":4590},"        \"\"\"Get entries from last N seconds\"\"\"\n",{"type":606,"tag":636,"props":4592,"children":4593},{"class":638,"line":291},[4594,4599,4603,4608,4612],{"type":606,"tag":636,"props":4595,"children":4596},{"style":648},[4597],{"type":612,"value":4598},"        cutoff ",{"type":606,"tag":636,"props":4600,"children":4601},{"style":642},[4602],{"type":612,"value":703},{"type":606,"tag":636,"props":4604,"children":4605},{"style":648},[4606],{"type":612,"value":4607}," time.time() ",{"type":606,"tag":636,"props":4609,"children":4610},{"style":642},[4611],{"type":612,"value":3730},{"type":606,"tag":636,"props":4613,"children":4614},{"style":648},[4615],{"type":612,"value":4616}," seconds\n",{"type":606,"tag":636,"props":4618,"children":4619},{"class":638,"line":302},[4620,4624],{"type":606,"tag":636,"props":4621,"children":4622},{"style":642},[4623],{"type":612,"value":2974},{"type":606,"tag":636,"props":4625,"children":4626},{"style":648},[4627],{"type":612,"value":3146},{"type":606,"tag":636,"props":4629,"children":4630},{"class":638,"line":311},[4631,4635,4639,4643,4647,4651],{"type":606,"tag":636,"props":4632,"children":4633},{"style":648},[4634],{"type":612,"value":4474},{"type":606,"tag":636,"props":4636,"children":4637},{"style":642},[4638],{"type":612,"value":3235},{"type":606,"tag":636,"props":4640,"children":4641},{"style":648},[4642],{"type":612,"value":4483},{"type":606,"tag":636,"props":4644,"children":4645},{"style":642},[4646],{"type":612,"value":3245},{"type":606,"tag":636,"props":4648,"children":4649},{"style":738},[4650],{"type":612,"value":3721},{"type":606,"tag":636,"props":4652,"children":4653},{"style":648},[4654],{"type":612,"value":4496},{"type":606,"tag":636,"props":4656,"children":4657},{"class":638,"line":320},[4658,4662,4666,4670,4674,4679],{"type":606,"tag":636,"props":4659,"children":4660},{"style":642},[4661],{"type":612,"value":4504},{"type":606,"tag":636,"props":4663,"children":4664},{"style":648},[4665],{"type":612,"value":4518},{"type":606,"tag":636,"props":4667,"children":4668},{"style":754},[4669],{"type":612,"value":4523},{"type":606,"tag":636,"props":4671,"children":4672},{"style":648},[4673],{"type":612,"value":4528},{"type":606,"tag":636,"props":4675,"children":4676},{"style":642},[4677],{"type":612,"value":4678},">=",{"type":606,"tag":636,"props":4680,"children":4681},{"style":648},[4682],{"type":612,"value":4683}," cutoff\n",{"type":606,"tag":636,"props":4685,"children":4686},{"class":638,"line":329},[4687],{"type":606,"tag":636,"props":4688,"children":4689},{"style":648},[4690],{"type":612,"value":4545},{"type":606,"tag":636,"props":4692,"children":4693},{"class":638,"line":338},[4694],{"type":606,"tag":636,"props":4695,"children":4696},{"style":648},[4697],{"type":612,"value":3493},{"type":606,"tag":636,"props":4699,"children":4700},{"class":638,"line":347},[4701,4705,4710],{"type":606,"tag":636,"props":4702,"children":4703},{"style":642},[4704],{"type":612,"value":3501},{"type":606,"tag":636,"props":4706,"children":4707},{"style":2676},[4708],{"type":612,"value":4709}," to_json",{"type":606,"tag":636,"props":4711,"children":4712},{"style":648},[4713],{"type":612,"value":3511},{"type":606,"tag":636,"props":4715,"children":4716},{"class":638,"line":356},[4717],{"type":606,"tag":636,"props":4718,"children":4719},{"style":754},[4720],{"type":612,"value":4721},"        \"\"\"Export data as JSON\"\"\"\n",{"type":606,"tag":636,"props":4723,"children":4724},{"class":638,"line":367},[4725,4729,4734,4738,4743,4748,4752,4757],{"type":606,"tag":636,"props":4726,"children":4727},{"style":642},[4728],{"type":612,"value":2974},{"type":606,"tag":636,"props":4730,"children":4731},{"style":648},[4732],{"type":612,"value":4733}," json.dumps(",{"type":606,"tag":636,"props":4735,"children":4736},{"style":738},[4737],{"type":612,"value":3637},{"type":606,"tag":636,"props":4739,"children":4740},{"style":648},[4741],{"type":612,"value":4742},".data, ",{"type":606,"tag":636,"props":4744,"children":4745},{"style":2475},[4746],{"type":612,"value":4747},"indent",{"type":606,"tag":636,"props":4749,"children":4750},{"style":642},[4751],{"type":612,"value":703},{"type":606,"tag":636,"props":4753,"children":4754},{"style":738},[4755],{"type":612,"value":4756},"2",{"type":606,"tag":636,"props":4758,"children":4759},{"style":648},[4760],{"type":612,"value":782},{"type":606,"tag":636,"props":4762,"children":4763},{"class":638,"line":376},[4764],{"type":606,"tag":636,"props":4765,"children":4766},{"emptyLinePlaceholder":13},[4767],{"type":612,"value":681},{"type":606,"tag":636,"props":4769,"children":4770},{"class":638,"line":385},[4771],{"type":606,"tag":636,"props":4772,"children":4773},{"style":687},[4774],{"type":612,"value":3056},{"type":606,"tag":636,"props":4776,"children":4777},{"class":638,"line":394},[4778,4783,4787],{"type":606,"tag":636,"props":4779,"children":4780},{"style":648},[4781],{"type":612,"value":4782},"logger ",{"type":606,"tag":636,"props":4784,"children":4785},{"style":642},[4786],{"type":612,"value":703},{"type":606,"tag":636,"props":4788,"children":4789},{"style":648},[4790],{"type":612,"value":4791}," TimestampedData()\n",{"type":606,"tag":636,"props":4793,"children":4794},{"class":638,"line":403},[4795],{"type":606,"tag":636,"props":4796,"children":4797},{"emptyLinePlaceholder":13},[4798],{"type":612,"value":681},{"type":606,"tag":636,"props":4800,"children":4801},{"class":638,"line":412},[4802],{"type":606,"tag":636,"props":4803,"children":4804},{"style":687},[4805],{"type":612,"value":4806},"# Add some sample data\n",{"type":606,"tag":636,"props":4808,"children":4809},{"class":638,"line":423},[4810,4815,4820,4825,4830,4834,4839,4843,4848],{"type":606,"tag":636,"props":4811,"children":4812},{"style":648},[4813],{"type":612,"value":4814},"logger.add_entry({",{"type":606,"tag":636,"props":4816,"children":4817},{"style":754},[4818],{"type":612,"value":4819},"\"temperature\"",{"type":606,"tag":636,"props":4821,"children":4822},{"style":648},[4823],{"type":612,"value":4824},": ",{"type":606,"tag":636,"props":4826,"children":4827},{"style":738},[4828],{"type":612,"value":4829},"22.5",{"type":606,"tag":636,"props":4831,"children":4832},{"style":648},[4833],{"type":612,"value":939},{"type":606,"tag":636,"props":4835,"children":4836},{"style":754},[4837],{"type":612,"value":4838},"\"humidity\"",{"type":606,"tag":636,"props":4840,"children":4841},{"style":648},[4842],{"type":612,"value":4824},{"type":606,"tag":636,"props":4844,"children":4845},{"style":738},[4846],{"type":612,"value":4847},"65",{"type":606,"tag":636,"props":4849,"children":4850},{"style":648},[4851],{"type":612,"value":4852},"})\n",{"type":606,"tag":636,"props":4854,"children":4855},{"class":638,"line":432},[4856,4860,4864],{"type":606,"tag":636,"props":4857,"children":4858},{"style":648},[4859],{"type":612,"value":4022},{"type":606,"tag":636,"props":4861,"children":4862},{"style":738},[4863],{"type":612,"value":4027},{"type":606,"tag":636,"props":4865,"children":4866},{"style":648},[4867],{"type":612,"value":782},{"type":606,"tag":636,"props":4869,"children":4870},{"class":638,"line":441},[4871,4875,4879,4883,4888,4892,4896,4900,4905],{"type":606,"tag":636,"props":4872,"children":4873},{"style":648},[4874],{"type":612,"value":4814},{"type":606,"tag":636,"props":4876,"children":4877},{"style":754},[4878],{"type":612,"value":4819},{"type":606,"tag":636,"props":4880,"children":4881},{"style":648},[4882],{"type":612,"value":4824},{"type":606,"tag":636,"props":4884,"children":4885},{"style":738},[4886],{"type":612,"value":4887},"23.1",{"type":606,"tag":636,"props":4889,"children":4890},{"style":648},[4891],{"type":612,"value":939},{"type":606,"tag":636,"props":4893,"children":4894},{"style":754},[4895],{"type":612,"value":4838},{"type":606,"tag":636,"props":4897,"children":4898},{"style":648},[4899],{"type":612,"value":4824},{"type":606,"tag":636,"props":4901,"children":4902},{"style":738},[4903],{"type":612,"value":4904},"63",{"type":606,"tag":636,"props":4906,"children":4907},{"style":648},[4908],{"type":612,"value":4852},{"type":606,"tag":636,"props":4910,"children":4911},{"class":638,"line":450},[4912,4916,4920],{"type":606,"tag":636,"props":4913,"children":4914},{"style":648},[4915],{"type":612,"value":4022},{"type":606,"tag":636,"props":4917,"children":4918},{"style":738},[4919],{"type":612,"value":4027},{"type":606,"tag":636,"props":4921,"children":4922},{"style":648},[4923],{"type":612,"value":782},{"type":606,"tag":636,"props":4925,"children":4926},{"class":638,"line":459},[4927,4931,4935,4939,4944,4948,4952,4956,4961],{"type":606,"tag":636,"props":4928,"children":4929},{"style":648},[4930],{"type":612,"value":4814},{"type":606,"tag":636,"props":4932,"children":4933},{"style":754},[4934],{"type":612,"value":4819},{"type":606,"tag":636,"props":4936,"children":4937},{"style":648},[4938],{"type":612,"value":4824},{"type":606,"tag":636,"props":4940,"children":4941},{"style":738},[4942],{"type":612,"value":4943},"22.8",{"type":606,"tag":636,"props":4945,"children":4946},{"style":648},[4947],{"type":612,"value":939},{"type":606,"tag":636,"props":4949,"children":4950},{"style":754},[4951],{"type":612,"value":4838},{"type":606,"tag":636,"props":4953,"children":4954},{"style":648},[4955],{"type":612,"value":4824},{"type":606,"tag":636,"props":4957,"children":4958},{"style":738},[4959],{"type":612,"value":4960},"64",{"type":606,"tag":636,"props":4962,"children":4963},{"style":648},[4964],{"type":612,"value":4852},{"type":606,"tag":636,"props":4966,"children":4967},{"class":638,"line":468},[4968],{"type":606,"tag":636,"props":4969,"children":4970},{"emptyLinePlaceholder":13},[4971],{"type":612,"value":681},{"type":606,"tag":636,"props":4973,"children":4974},{"class":638,"line":477},[4975],{"type":606,"tag":636,"props":4976,"children":4977},{"style":687},[4978],{"type":612,"value":4979},"# Get recent entries\n",{"type":606,"tag":636,"props":4981,"children":4982},{"class":638,"line":488},[4983,4988,4992,4997,5002,5006,5010],{"type":606,"tag":636,"props":4984,"children":4985},{"style":648},[4986],{"type":612,"value":4987},"recent ",{"type":606,"tag":636,"props":4989,"children":4990},{"style":642},[4991],{"type":612,"value":703},{"type":606,"tag":636,"props":4993,"children":4994},{"style":648},[4995],{"type":612,"value":4996}," logger.get_recent_entries(",{"type":606,"tag":636,"props":4998,"children":4999},{"style":2475},[5000],{"type":612,"value":5001},"seconds",{"type":606,"tag":636,"props":5003,"children":5004},{"style":642},[5005],{"type":612,"value":703},{"type":606,"tag":636,"props":5007,"children":5008},{"style":738},[5009],{"type":612,"value":1411},{"type":606,"tag":636,"props":5011,"children":5012},{"style":648},[5013],{"type":612,"value":782},{"type":606,"tag":636,"props":5015,"children":5016},{"class":638,"line":497},[5017,5021,5025,5029,5034,5039,5044,5048,5052],{"type":606,"tag":636,"props":5018,"children":5019},{"style":738},[5020],{"type":612,"value":741},{"type":606,"tag":636,"props":5022,"children":5023},{"style":648},[5024],{"type":612,"value":746},{"type":606,"tag":636,"props":5026,"children":5027},{"style":642},[5028],{"type":612,"value":751},{"type":606,"tag":636,"props":5030,"children":5031},{"style":754},[5032],{"type":612,"value":5033},"\"Recent entries: ",{"type":606,"tag":636,"props":5035,"children":5036},{"style":738},[5037],{"type":612,"value":5038},"{len",{"type":606,"tag":636,"props":5040,"children":5041},{"style":648},[5042],{"type":612,"value":5043},"(recent)",{"type":606,"tag":636,"props":5045,"children":5046},{"style":738},[5047],{"type":612,"value":772},{"type":606,"tag":636,"props":5049,"children":5050},{"style":754},[5051],{"type":612,"value":777},{"type":606,"tag":636,"props":5053,"children":5054},{"style":648},[5055],{"type":612,"value":782},{"type":606,"tag":636,"props":5057,"children":5058},{"class":638,"line":506},[5059],{"type":606,"tag":636,"props":5060,"children":5061},{"emptyLinePlaceholder":13},[5062],{"type":612,"value":681},{"type":606,"tag":636,"props":5064,"children":5065},{"class":638,"line":515},[5066],{"type":606,"tag":636,"props":5067,"children":5068},{"style":687},[5069],{"type":612,"value":5070},"# Print formatted data\n",{"type":606,"tag":636,"props":5072,"children":5073},{"class":638,"line":524},[5074,5078,5082,5086],{"type":606,"tag":636,"props":5075,"children":5076},{"style":642},[5077],{"type":612,"value":3235},{"type":606,"tag":636,"props":5079,"children":5080},{"style":648},[5081],{"type":612,"value":4483},{"type":606,"tag":636,"props":5083,"children":5084},{"style":642},[5085],{"type":612,"value":3245},{"type":606,"tag":636,"props":5087,"children":5088},{"style":648},[5089],{"type":612,"value":5090}," logger.data:\n",{"type":606,"tag":636,"props":5092,"children":5093},{"class":638,"line":533},[5094,5099,5103,5108,5112],{"type":606,"tag":636,"props":5095,"children":5096},{"style":648},[5097],{"type":612,"value":5098},"    dt ",{"type":606,"tag":636,"props":5100,"children":5101},{"style":642},[5102],{"type":612,"value":703},{"type":606,"tag":636,"props":5104,"children":5105},{"style":648},[5106],{"type":612,"value":5107}," datetime.fromtimestamp(entry[",{"type":606,"tag":636,"props":5109,"children":5110},{"style":754},[5111],{"type":612,"value":4523},{"type":606,"tag":636,"props":5113,"children":5114},{"style":648},[5115],{"type":612,"value":5116},"])\n",{"type":606,"tag":636,"props":5118,"children":5119},{"class":638,"line":544},[5120,5125,5129,5133,5137,5141,5146,5151,5156,5160,5164,5168,5173,5178,5183,5187,5191],{"type":606,"tag":636,"props":5121,"children":5122},{"style":738},[5123],{"type":612,"value":5124},"    print",{"type":606,"tag":636,"props":5126,"children":5127},{"style":648},[5128],{"type":612,"value":746},{"type":606,"tag":636,"props":5130,"children":5131},{"style":642},[5132],{"type":612,"value":751},{"type":606,"tag":636,"props":5134,"children":5135},{"style":754},[5136],{"type":612,"value":777},{"type":606,"tag":636,"props":5138,"children":5139},{"style":738},[5140],{"type":612,"value":762},{"type":606,"tag":636,"props":5142,"children":5143},{"style":648},[5144],{"type":612,"value":5145},"dt.strftime(",{"type":606,"tag":636,"props":5147,"children":5148},{"style":754},[5149],{"type":612,"value":5150},"'%H:%M:%S'",{"type":606,"tag":636,"props":5152,"children":5153},{"style":648},[5154],{"type":612,"value":5155},")",{"type":606,"tag":636,"props":5157,"children":5158},{"style":738},[5159],{"type":612,"value":772},{"type":606,"tag":636,"props":5161,"children":5162},{"style":754},[5163],{"type":612,"value":4824},{"type":606,"tag":636,"props":5165,"children":5166},{"style":738},[5167],{"type":612,"value":762},{"type":606,"tag":636,"props":5169,"children":5170},{"style":648},[5171],{"type":612,"value":5172},"entry[",{"type":606,"tag":636,"props":5174,"children":5175},{"style":754},[5176],{"type":612,"value":5177},"'data'",{"type":606,"tag":636,"props":5179,"children":5180},{"style":648},[5181],{"type":612,"value":5182},"]",{"type":606,"tag":636,"props":5184,"children":5185},{"style":738},[5186],{"type":612,"value":772},{"type":606,"tag":636,"props":5188,"children":5189},{"style":754},[5190],{"type":612,"value":777},{"type":606,"tag":636,"props":5192,"children":5193},{"style":648},[5194],{"type":612,"value":782},{"type":606,"tag":1062,"props":5196,"children":5198},{"id":5197},"timestamp-conversion-reference",[5199],{"type":612,"value":5200},"📊 Timestamp Conversion Reference",{"type":606,"tag":1166,"props":5202,"children":5204},{"id":5203},"common-timestamp-formats",[5205],{"type":612,"value":5206},"Common Timestamp Formats",{"type":606,"tag":5208,"props":5209,"children":5210},"table",{},[5211,5240],{"type":606,"tag":5212,"props":5213,"children":5214},"thead",{},[5215],{"type":606,"tag":5216,"props":5217,"children":5218},"tr",{},[5219,5225,5230,5235],{"type":606,"tag":5220,"props":5221,"children":5222},"th",{},[5223],{"type":612,"value":5224},"Format",{"type":606,"tag":5220,"props":5226,"children":5227},{},[5228],{"type":612,"value":5229},"Description",{"type":606,"tag":5220,"props":5231,"children":5232},{},[5233],{"type":612,"value":5234},"Example",{"type":606,"tag":5220,"props":5236,"children":5237},{},[5238],{"type":612,"value":5239},"Python Conversion",{"type":606,"tag":5241,"props":5242,"children":5243},"tbody",{},[5244,5276,5307,5338],{"type":606,"tag":5216,"props":5245,"children":5246},{},[5247,5253,5258,5267],{"type":606,"tag":5248,"props":5249,"children":5250},"td",{},[5251],{"type":612,"value":5252},"Unix (seconds)",{"type":606,"tag":5248,"props":5254,"children":5255},{},[5256],{"type":612,"value":5257},"Standard Unix timestamp",{"type":606,"tag":5248,"props":5259,"children":5260},{},[5261],{"type":606,"tag":632,"props":5262,"children":5264},{"className":5263},[],[5265],{"type":612,"value":5266},"1710519045",{"type":606,"tag":5248,"props":5268,"children":5269},{},[5270],{"type":606,"tag":632,"props":5271,"children":5273},{"className":5272},[],[5274],{"type":612,"value":5275},"time.time()",{"type":606,"tag":5216,"props":5277,"children":5278},{},[5279,5284,5289,5298],{"type":606,"tag":5248,"props":5280,"children":5281},{},[5282],{"type":612,"value":5283},"Milliseconds",{"type":606,"tag":5248,"props":5285,"children":5286},{},[5287],{"type":612,"value":5288},"JavaScript/API common",{"type":606,"tag":5248,"props":5290,"children":5291},{},[5292],{"type":606,"tag":632,"props":5293,"children":5295},{"className":5294},[],[5296],{"type":612,"value":5297},"1710519045123",{"type":606,"tag":5248,"props":5299,"children":5300},{},[5301],{"type":606,"tag":632,"props":5302,"children":5304},{"className":5303},[],[5305],{"type":612,"value":5306},"int(time.time() * 1000)",{"type":606,"tag":5216,"props":5308,"children":5309},{},[5310,5315,5320,5329],{"type":606,"tag":5248,"props":5311,"children":5312},{},[5313],{"type":612,"value":5314},"Microseconds",{"type":606,"tag":5248,"props":5316,"children":5317},{},[5318],{"type":612,"value":5319},"High precision",{"type":606,"tag":5248,"props":5321,"children":5322},{},[5323],{"type":606,"tag":632,"props":5324,"children":5326},{"className":5325},[],[5327],{"type":612,"value":5328},"1710519045123456",{"type":606,"tag":5248,"props":5330,"children":5331},{},[5332],{"type":606,"tag":632,"props":5333,"children":5335},{"className":5334},[],[5336],{"type":612,"value":5337},"int(time.time() * 1_000_000)",{"type":606,"tag":5216,"props":5339,"children":5340},{},[5341,5346,5351,5360],{"type":606,"tag":5248,"props":5342,"children":5343},{},[5344],{"type":612,"value":5345},"ISO String",{"type":606,"tag":5248,"props":5347,"children":5348},{},[5349],{"type":612,"value":5350},"Human readable",{"type":606,"tag":5248,"props":5352,"children":5353},{},[5354],{"type":606,"tag":632,"props":5355,"children":5357},{"className":5356},[],[5358],{"type":612,"value":5359},"2024-03-15T14:30:45",{"type":606,"tag":5248,"props":5361,"children":5362},{},[5363],{"type":606,"tag":632,"props":5364,"children":5366},{"className":5365},[],[5367],{"type":612,"value":5368},"datetime.now().isoformat()",{"type":606,"tag":1166,"props":5370,"children":5372},{"id":5371},"api-integration-examples",[5373],{"type":612,"value":5374},"API Integration Examples",{"type":606,"tag":621,"props":5376,"children":5377},{},[5378],{"type":606,"tag":625,"props":5379,"children":5381},{"className":627,"code":5380,"language":629,"meta":8,"style":8},"import time\nfrom datetime import datetime, timezone\nimport json\n\ndef prepare_api_data(data):\n    \"\"\"Prepare data for API submission with timestamps\"\"\"\n    return {\n        'timestamp': int(time.time()),\n        'timestamp_ms': int(time.time() * 1000),\n        'iso_timestamp': datetime.now(timezone.utc).isoformat(),\n        'data': data\n    }\n\ndef parse_api_response(response_data):\n    \"\"\"Parse API response with various timestamp formats\"\"\"\n    results = {}\n    \n    # Handle different timestamp formats\n    if 'timestamp' in response_data:\n        ts = response_data['timestamp']\n        # Detect if milliseconds (roughly > year 2001 in ms)\n        if ts > 1000000000000:\n            results['datetime'] = datetime.fromtimestamp(ts / 1000)\n            results['format'] = 'milliseconds'\n        else:\n            results['datetime'] = datetime.fromtimestamp(ts)\n            results['format'] = 'seconds'\n    \n    if 'iso_timestamp' in response_data:\n        iso_str = response_data['iso_timestamp']\n        # Parse ISO format (basic parsing)\n        if iso_str.endswith('Z'):\n            iso_str = iso_str[:-1] + '+00:00'\n        results['iso_datetime'] = datetime.fromisoformat(iso_str)\n    \n    return results\n\n# Example API data\napi_data = prepare_api_data({\"sensor_id\": \"temp_01\", \"value\": 23.5})\nprint(\"API Data:\")\nprint(json.dumps(api_data, indent=2))\n\n# Example parsing\nresponse = {\n    'timestamp': 1710519045123,  # milliseconds\n    'iso_timestamp': '2024-03-15T14:30:45Z',\n    'status': 'success'\n}\n\nparsed = parse_api_response(response)\nprint(\"\\nParsed Response:\")\nfor key, value in parsed.items():\n    print(f\"{key}: {value}\")\n",[5382],{"type":606,"tag":632,"props":5383,"children":5384},{"__ignoreMap":8},[5385,5396,5415,5426,5433,5450,5458,5469,5491,5524,5537,5549,5557,5564,5581,5589,5606,5613,5621,5643,5668,5676,5701,5739,5764,5776,5800,5824,5831,5851,5876,5884,5905,5944,5970,5977,5989,5996,6004,6057,6077,6106,6113,6121,6137,6163,6185,6202,6210,6217,6234,6263,6284],{"type":606,"tag":636,"props":5386,"children":5387},{"class":638,"line":12},[5388,5392],{"type":606,"tag":636,"props":5389,"children":5390},{"style":642},[5391],{"type":612,"value":645},{"type":606,"tag":636,"props":5393,"children":5394},{"style":648},[5395],{"type":612,"value":651},{"type":606,"tag":636,"props":5397,"children":5398},{"class":638,"line":27},[5399,5403,5407,5411],{"type":606,"tag":636,"props":5400,"children":5401},{"style":642},[5402],{"type":612,"value":659},{"type":606,"tag":636,"props":5404,"children":5405},{"style":648},[5406],{"type":612,"value":664},{"type":606,"tag":636,"props":5408,"children":5409},{"style":642},[5410],{"type":612,"value":645},{"type":606,"tag":636,"props":5412,"children":5413},{"style":648},[5414],{"type":612,"value":2172},{"type":606,"tag":636,"props":5416,"children":5417},{"class":638,"line":36},[5418,5422],{"type":606,"tag":636,"props":5419,"children":5420},{"style":642},[5421],{"type":612,"value":645},{"type":606,"tag":636,"props":5423,"children":5424},{"style":648},[5425],{"type":612,"value":4191},{"type":606,"tag":636,"props":5427,"children":5428},{"class":638,"line":45},[5429],{"type":606,"tag":636,"props":5430,"children":5431},{"emptyLinePlaceholder":13},[5432],{"type":612,"value":681},{"type":606,"tag":636,"props":5434,"children":5435},{"class":638,"line":54},[5436,5440,5445],{"type":606,"tag":636,"props":5437,"children":5438},{"style":642},[5439],{"type":612,"value":2673},{"type":606,"tag":636,"props":5441,"children":5442},{"style":2676},[5443],{"type":612,"value":5444}," prepare_api_data",{"type":606,"tag":636,"props":5446,"children":5447},{"style":648},[5448],{"type":612,"value":5449},"(data):\n",{"type":606,"tag":636,"props":5451,"children":5452},{"class":638,"line":63},[5453],{"type":606,"tag":636,"props":5454,"children":5455},{"style":754},[5456],{"type":612,"value":5457},"    \"\"\"Prepare data for API submission with timestamps\"\"\"\n",{"type":606,"tag":636,"props":5459,"children":5460},{"class":638,"line":72},[5461,5465],{"type":606,"tag":636,"props":5462,"children":5463},{"style":642},[5464],{"type":612,"value":2700},{"type":606,"tag":636,"props":5466,"children":5467},{"style":648},[5468],{"type":612,"value":4352},{"type":606,"tag":636,"props":5470,"children":5471},{"class":638,"line":81},[5472,5477,5481,5486],{"type":606,"tag":636,"props":5473,"children":5474},{"style":754},[5475],{"type":612,"value":5476},"        'timestamp'",{"type":606,"tag":636,"props":5478,"children":5479},{"style":648},[5480],{"type":612,"value":4824},{"type":606,"tag":636,"props":5482,"children":5483},{"style":738},[5484],{"type":612,"value":5485},"int",{"type":606,"tag":636,"props":5487,"children":5488},{"style":648},[5489],{"type":612,"value":5490},"(time.time()),\n",{"type":606,"tag":636,"props":5492,"children":5493},{"class":638,"line":785},[5494,5499,5503,5507,5511,5515,5519],{"type":606,"tag":636,"props":5495,"children":5496},{"style":754},[5497],{"type":612,"value":5498},"        'timestamp_ms'",{"type":606,"tag":636,"props":5500,"children":5501},{"style":648},[5502],{"type":612,"value":4824},{"type":606,"tag":636,"props":5504,"children":5505},{"style":738},[5506],{"type":612,"value":5485},{"type":606,"tag":636,"props":5508,"children":5509},{"style":648},[5510],{"type":612,"value":2709},{"type":606,"tag":636,"props":5512,"children":5513},{"style":642},[5514],{"type":612,"value":1776},{"type":606,"tag":636,"props":5516,"children":5517},{"style":738},[5518],{"type":612,"value":1781},{"type":606,"tag":636,"props":5520,"children":5521},{"style":648},[5522],{"type":612,"value":5523},"),\n",{"type":606,"tag":636,"props":5525,"children":5526},{"class":638,"line":99},[5527,5532],{"type":606,"tag":636,"props":5528,"children":5529},{"style":754},[5530],{"type":612,"value":5531},"        'iso_timestamp'",{"type":606,"tag":636,"props":5533,"children":5534},{"style":648},[5535],{"type":612,"value":5536},": datetime.now(timezone.utc).isoformat(),\n",{"type":606,"tag":636,"props":5538,"children":5539},{"class":638,"line":108},[5540,5545],{"type":606,"tag":636,"props":5541,"children":5542},{"style":754},[5543],{"type":612,"value":5544},"        'data'",{"type":606,"tag":636,"props":5546,"children":5547},{"style":648},[5548],{"type":612,"value":4391},{"type":606,"tag":636,"props":5550,"children":5551},{"class":638,"line":117},[5552],{"type":606,"tag":636,"props":5553,"children":5554},{"style":648},[5555],{"type":612,"value":5556},"    }\n",{"type":606,"tag":636,"props":5558,"children":5559},{"class":638,"line":126},[5560],{"type":606,"tag":636,"props":5561,"children":5562},{"emptyLinePlaceholder":13},[5563],{"type":612,"value":681},{"type":606,"tag":636,"props":5565,"children":5566},{"class":638,"line":135},[5567,5571,5576],{"type":606,"tag":636,"props":5568,"children":5569},{"style":642},[5570],{"type":612,"value":2673},{"type":606,"tag":636,"props":5572,"children":5573},{"style":2676},[5574],{"type":612,"value":5575}," parse_api_response",{"type":606,"tag":636,"props":5577,"children":5578},{"style":648},[5579],{"type":612,"value":5580},"(response_data):\n",{"type":606,"tag":636,"props":5582,"children":5583},{"class":638,"line":144},[5584],{"type":606,"tag":636,"props":5585,"children":5586},{"style":754},[5587],{"type":612,"value":5588},"    \"\"\"Parse API response with various timestamp formats\"\"\"\n",{"type":606,"tag":636,"props":5590,"children":5591},{"class":638,"line":153},[5592,5597,5601],{"type":606,"tag":636,"props":5593,"children":5594},{"style":648},[5595],{"type":612,"value":5596},"    results ",{"type":606,"tag":636,"props":5598,"children":5599},{"style":642},[5600],{"type":612,"value":703},{"type":606,"tag":636,"props":5602,"children":5603},{"style":648},[5604],{"type":612,"value":5605}," {}\n",{"type":606,"tag":636,"props":5607,"children":5608},{"class":638,"line":163},[5609],{"type":606,"tag":636,"props":5610,"children":5611},{"style":648},[5612],{"type":612,"value":3493},{"type":606,"tag":636,"props":5614,"children":5615},{"class":638,"line":172},[5616],{"type":606,"tag":636,"props":5617,"children":5618},{"style":687},[5619],{"type":612,"value":5620},"    # Handle different timestamp formats\n",{"type":606,"tag":636,"props":5622,"children":5623},{"class":638,"line":181},[5624,5628,5633,5638],{"type":606,"tag":636,"props":5625,"children":5626},{"style":642},[5627],{"type":612,"value":2775},{"type":606,"tag":636,"props":5629,"children":5630},{"style":754},[5631],{"type":612,"value":5632}," 'timestamp'",{"type":606,"tag":636,"props":5634,"children":5635},{"style":642},[5636],{"type":612,"value":5637}," in",{"type":606,"tag":636,"props":5639,"children":5640},{"style":648},[5641],{"type":612,"value":5642}," response_data:\n",{"type":606,"tag":636,"props":5644,"children":5645},{"class":638,"line":190},[5646,5651,5655,5660,5664],{"type":606,"tag":636,"props":5647,"children":5648},{"style":648},[5649],{"type":612,"value":5650},"        ts ",{"type":606,"tag":636,"props":5652,"children":5653},{"style":642},[5654],{"type":612,"value":703},{"type":606,"tag":636,"props":5656,"children":5657},{"style":648},[5658],{"type":612,"value":5659}," response_data[",{"type":606,"tag":636,"props":5661,"children":5662},{"style":754},[5663],{"type":612,"value":4523},{"type":606,"tag":636,"props":5665,"children":5666},{"style":648},[5667],{"type":612,"value":3220},{"type":606,"tag":636,"props":5669,"children":5670},{"class":638,"line":199},[5671],{"type":606,"tag":636,"props":5672,"children":5673},{"style":687},[5674],{"type":612,"value":5675},"        # Detect if milliseconds (roughly > year 2001 in ms)\n",{"type":606,"tag":636,"props":5677,"children":5678},{"class":638,"line":208},[5679,5683,5687,5692,5697],{"type":606,"tag":636,"props":5680,"children":5681},{"style":642},[5682],{"type":612,"value":3885},{"type":606,"tag":636,"props":5684,"children":5685},{"style":648},[5686],{"type":612,"value":3240},{"type":606,"tag":636,"props":5688,"children":5689},{"style":642},[5690],{"type":612,"value":5691},">",{"type":606,"tag":636,"props":5693,"children":5694},{"style":738},[5695],{"type":612,"value":5696}," 1000000000000",{"type":606,"tag":636,"props":5698,"children":5699},{"style":648},[5700],{"type":612,"value":2950},{"type":606,"tag":636,"props":5702,"children":5703},{"class":638,"line":217},[5704,5709,5714,5718,5722,5727,5731,5735],{"type":606,"tag":636,"props":5705,"children":5706},{"style":648},[5707],{"type":612,"value":5708},"            results[",{"type":606,"tag":636,"props":5710,"children":5711},{"style":754},[5712],{"type":612,"value":5713},"'datetime'",{"type":606,"tag":636,"props":5715,"children":5716},{"style":648},[5717],{"type":612,"value":4528},{"type":606,"tag":636,"props":5719,"children":5720},{"style":642},[5721],{"type":612,"value":703},{"type":606,"tag":636,"props":5723,"children":5724},{"style":648},[5725],{"type":612,"value":5726}," datetime.fromtimestamp(ts ",{"type":606,"tag":636,"props":5728,"children":5729},{"style":642},[5730],{"type":612,"value":1969},{"type":606,"tag":636,"props":5732,"children":5733},{"style":738},[5734],{"type":612,"value":1781},{"type":606,"tag":636,"props":5736,"children":5737},{"style":648},[5738],{"type":612,"value":782},{"type":606,"tag":636,"props":5740,"children":5741},{"class":638,"line":227},[5742,5746,5751,5755,5759],{"type":606,"tag":636,"props":5743,"children":5744},{"style":648},[5745],{"type":612,"value":5708},{"type":606,"tag":636,"props":5747,"children":5748},{"style":754},[5749],{"type":612,"value":5750},"'format'",{"type":606,"tag":636,"props":5752,"children":5753},{"style":648},[5754],{"type":612,"value":4528},{"type":606,"tag":636,"props":5756,"children":5757},{"style":642},[5758],{"type":612,"value":703},{"type":606,"tag":636,"props":5760,"children":5761},{"style":754},[5762],{"type":612,"value":5763}," 'milliseconds'\n",{"type":606,"tag":636,"props":5765,"children":5766},{"class":638,"line":236},[5767,5772],{"type":606,"tag":636,"props":5768,"children":5769},{"style":642},[5770],{"type":612,"value":5771},"        else",{"type":606,"tag":636,"props":5773,"children":5774},{"style":648},[5775],{"type":612,"value":2950},{"type":606,"tag":636,"props":5777,"children":5778},{"class":638,"line":245},[5779,5783,5787,5791,5795],{"type":606,"tag":636,"props":5780,"children":5781},{"style":648},[5782],{"type":612,"value":5708},{"type":606,"tag":636,"props":5784,"children":5785},{"style":754},[5786],{"type":612,"value":5713},{"type":606,"tag":636,"props":5788,"children":5789},{"style":648},[5790],{"type":612,"value":4528},{"type":606,"tag":636,"props":5792,"children":5793},{"style":642},[5794],{"type":612,"value":703},{"type":606,"tag":636,"props":5796,"children":5797},{"style":648},[5798],{"type":612,"value":5799}," datetime.fromtimestamp(ts)\n",{"type":606,"tag":636,"props":5801,"children":5802},{"class":638,"line":254},[5803,5807,5811,5815,5819],{"type":606,"tag":636,"props":5804,"children":5805},{"style":648},[5806],{"type":612,"value":5708},{"type":606,"tag":636,"props":5808,"children":5809},{"style":754},[5810],{"type":612,"value":5750},{"type":606,"tag":636,"props":5812,"children":5813},{"style":648},[5814],{"type":612,"value":4528},{"type":606,"tag":636,"props":5816,"children":5817},{"style":642},[5818],{"type":612,"value":703},{"type":606,"tag":636,"props":5820,"children":5821},{"style":754},[5822],{"type":612,"value":5823}," 'seconds'\n",{"type":606,"tag":636,"props":5825,"children":5826},{"class":638,"line":263},[5827],{"type":606,"tag":636,"props":5828,"children":5829},{"style":648},[5830],{"type":612,"value":3493},{"type":606,"tag":636,"props":5832,"children":5833},{"class":638,"line":272},[5834,5838,5843,5847],{"type":606,"tag":636,"props":5835,"children":5836},{"style":642},[5837],{"type":612,"value":2775},{"type":606,"tag":636,"props":5839,"children":5840},{"style":754},[5841],{"type":612,"value":5842}," 'iso_timestamp'",{"type":606,"tag":636,"props":5844,"children":5845},{"style":642},[5846],{"type":612,"value":5637},{"type":606,"tag":636,"props":5848,"children":5849},{"style":648},[5850],{"type":612,"value":5642},{"type":606,"tag":636,"props":5852,"children":5853},{"class":638,"line":281},[5854,5859,5863,5867,5872],{"type":606,"tag":636,"props":5855,"children":5856},{"style":648},[5857],{"type":612,"value":5858},"        iso_str ",{"type":606,"tag":636,"props":5860,"children":5861},{"style":642},[5862],{"type":612,"value":703},{"type":606,"tag":636,"props":5864,"children":5865},{"style":648},[5866],{"type":612,"value":5659},{"type":606,"tag":636,"props":5868,"children":5869},{"style":754},[5870],{"type":612,"value":5871},"'iso_timestamp'",{"type":606,"tag":636,"props":5873,"children":5874},{"style":648},[5875],{"type":612,"value":3220},{"type":606,"tag":636,"props":5877,"children":5878},{"class":638,"line":291},[5879],{"type":606,"tag":636,"props":5880,"children":5881},{"style":687},[5882],{"type":612,"value":5883},"        # Parse ISO format (basic parsing)\n",{"type":606,"tag":636,"props":5885,"children":5886},{"class":638,"line":302},[5887,5891,5896,5901],{"type":606,"tag":636,"props":5888,"children":5889},{"style":642},[5890],{"type":612,"value":3885},{"type":606,"tag":636,"props":5892,"children":5893},{"style":648},[5894],{"type":612,"value":5895}," iso_str.endswith(",{"type":606,"tag":636,"props":5897,"children":5898},{"style":754},[5899],{"type":612,"value":5900},"'Z'",{"type":606,"tag":636,"props":5902,"children":5903},{"style":648},[5904],{"type":612,"value":2759},{"type":606,"tag":636,"props":5906,"children":5907},{"class":638,"line":311},[5908,5913,5917,5922,5926,5930,5934,5939],{"type":606,"tag":636,"props":5909,"children":5910},{"style":648},[5911],{"type":612,"value":5912},"            iso_str ",{"type":606,"tag":636,"props":5914,"children":5915},{"style":642},[5916],{"type":612,"value":703},{"type":606,"tag":636,"props":5918,"children":5919},{"style":648},[5920],{"type":612,"value":5921}," iso_str[:",{"type":606,"tag":636,"props":5923,"children":5924},{"style":642},[5925],{"type":612,"value":3730},{"type":606,"tag":636,"props":5927,"children":5928},{"style":738},[5929],{"type":612,"value":1411},{"type":606,"tag":636,"props":5931,"children":5932},{"style":648},[5933],{"type":612,"value":4528},{"type":606,"tag":636,"props":5935,"children":5936},{"style":642},[5937],{"type":612,"value":5938},"+",{"type":606,"tag":636,"props":5940,"children":5941},{"style":754},[5942],{"type":612,"value":5943}," '+00:00'\n",{"type":606,"tag":636,"props":5945,"children":5946},{"class":638,"line":320},[5947,5952,5957,5961,5965],{"type":606,"tag":636,"props":5948,"children":5949},{"style":648},[5950],{"type":612,"value":5951},"        results[",{"type":606,"tag":636,"props":5953,"children":5954},{"style":754},[5955],{"type":612,"value":5956},"'iso_datetime'",{"type":606,"tag":636,"props":5958,"children":5959},{"style":648},[5960],{"type":612,"value":4528},{"type":606,"tag":636,"props":5962,"children":5963},{"style":642},[5964],{"type":612,"value":703},{"type":606,"tag":636,"props":5966,"children":5967},{"style":648},[5968],{"type":612,"value":5969}," datetime.fromisoformat(iso_str)\n",{"type":606,"tag":636,"props":5971,"children":5972},{"class":638,"line":329},[5973],{"type":606,"tag":636,"props":5974,"children":5975},{"style":648},[5976],{"type":612,"value":3493},{"type":606,"tag":636,"props":5978,"children":5979},{"class":638,"line":338},[5980,5984],{"type":606,"tag":636,"props":5981,"children":5982},{"style":642},[5983],{"type":612,"value":2700},{"type":606,"tag":636,"props":5985,"children":5986},{"style":648},[5987],{"type":612,"value":5988}," results\n",{"type":606,"tag":636,"props":5990,"children":5991},{"class":638,"line":347},[5992],{"type":606,"tag":636,"props":5993,"children":5994},{"emptyLinePlaceholder":13},[5995],{"type":612,"value":681},{"type":606,"tag":636,"props":5997,"children":5998},{"class":638,"line":356},[5999],{"type":606,"tag":636,"props":6000,"children":6001},{"style":687},[6002],{"type":612,"value":6003},"# Example API data\n",{"type":606,"tag":636,"props":6005,"children":6006},{"class":638,"line":367},[6007,6012,6016,6021,6026,6030,6035,6039,6044,6048,6053],{"type":606,"tag":636,"props":6008,"children":6009},{"style":648},[6010],{"type":612,"value":6011},"api_data ",{"type":606,"tag":636,"props":6013,"children":6014},{"style":642},[6015],{"type":612,"value":703},{"type":606,"tag":636,"props":6017,"children":6018},{"style":648},[6019],{"type":612,"value":6020}," prepare_api_data({",{"type":606,"tag":636,"props":6022,"children":6023},{"style":754},[6024],{"type":612,"value":6025},"\"sensor_id\"",{"type":606,"tag":636,"props":6027,"children":6028},{"style":648},[6029],{"type":612,"value":4824},{"type":606,"tag":636,"props":6031,"children":6032},{"style":754},[6033],{"type":612,"value":6034},"\"temp_01\"",{"type":606,"tag":636,"props":6036,"children":6037},{"style":648},[6038],{"type":612,"value":939},{"type":606,"tag":636,"props":6040,"children":6041},{"style":754},[6042],{"type":612,"value":6043},"\"value\"",{"type":606,"tag":636,"props":6045,"children":6046},{"style":648},[6047],{"type":612,"value":4824},{"type":606,"tag":636,"props":6049,"children":6050},{"style":738},[6051],{"type":612,"value":6052},"23.5",{"type":606,"tag":636,"props":6054,"children":6055},{"style":648},[6056],{"type":612,"value":4852},{"type":606,"tag":636,"props":6058,"children":6059},{"class":638,"line":376},[6060,6064,6068,6073],{"type":606,"tag":636,"props":6061,"children":6062},{"style":738},[6063],{"type":612,"value":741},{"type":606,"tag":636,"props":6065,"children":6066},{"style":648},[6067],{"type":612,"value":746},{"type":606,"tag":636,"props":6069,"children":6070},{"style":754},[6071],{"type":612,"value":6072},"\"API Data:\"",{"type":606,"tag":636,"props":6074,"children":6075},{"style":648},[6076],{"type":612,"value":782},{"type":606,"tag":636,"props":6078,"children":6079},{"class":638,"line":385},[6080,6084,6089,6093,6097,6101],{"type":606,"tag":636,"props":6081,"children":6082},{"style":738},[6083],{"type":612,"value":741},{"type":606,"tag":636,"props":6085,"children":6086},{"style":648},[6087],{"type":612,"value":6088},"(json.dumps(api_data, ",{"type":606,"tag":636,"props":6090,"children":6091},{"style":2475},[6092],{"type":612,"value":4747},{"type":606,"tag":636,"props":6094,"children":6095},{"style":642},[6096],{"type":612,"value":703},{"type":606,"tag":636,"props":6098,"children":6099},{"style":738},[6100],{"type":612,"value":4756},{"type":606,"tag":636,"props":6102,"children":6103},{"style":648},[6104],{"type":612,"value":6105},"))\n",{"type":606,"tag":636,"props":6107,"children":6108},{"class":638,"line":394},[6109],{"type":606,"tag":636,"props":6110,"children":6111},{"emptyLinePlaceholder":13},[6112],{"type":612,"value":681},{"type":606,"tag":636,"props":6114,"children":6115},{"class":638,"line":403},[6116],{"type":606,"tag":636,"props":6117,"children":6118},{"style":687},[6119],{"type":612,"value":6120},"# Example parsing\n",{"type":606,"tag":636,"props":6122,"children":6123},{"class":638,"line":412},[6124,6129,6133],{"type":606,"tag":636,"props":6125,"children":6126},{"style":648},[6127],{"type":612,"value":6128},"response ",{"type":606,"tag":636,"props":6130,"children":6131},{"style":642},[6132],{"type":612,"value":703},{"type":606,"tag":636,"props":6134,"children":6135},{"style":648},[6136],{"type":612,"value":4352},{"type":606,"tag":636,"props":6138,"children":6139},{"class":638,"line":423},[6140,6145,6149,6153,6158],{"type":606,"tag":636,"props":6141,"children":6142},{"style":754},[6143],{"type":612,"value":6144},"    'timestamp'",{"type":606,"tag":636,"props":6146,"children":6147},{"style":648},[6148],{"type":612,"value":4824},{"type":606,"tag":636,"props":6150,"children":6151},{"style":738},[6152],{"type":612,"value":5297},{"type":606,"tag":636,"props":6154,"children":6155},{"style":648},[6156],{"type":612,"value":6157},",  ",{"type":606,"tag":636,"props":6159,"children":6160},{"style":687},[6161],{"type":612,"value":6162},"# milliseconds\n",{"type":606,"tag":636,"props":6164,"children":6165},{"class":638,"line":432},[6166,6171,6175,6180],{"type":606,"tag":636,"props":6167,"children":6168},{"style":754},[6169],{"type":612,"value":6170},"    'iso_timestamp'",{"type":606,"tag":636,"props":6172,"children":6173},{"style":648},[6174],{"type":612,"value":4824},{"type":606,"tag":636,"props":6176,"children":6177},{"style":754},[6178],{"type":612,"value":6179},"'2024-03-15T14:30:45Z'",{"type":606,"tag":636,"props":6181,"children":6182},{"style":648},[6183],{"type":612,"value":6184},",\n",{"type":606,"tag":636,"props":6186,"children":6187},{"class":638,"line":441},[6188,6193,6197],{"type":606,"tag":636,"props":6189,"children":6190},{"style":754},[6191],{"type":612,"value":6192},"    'status'",{"type":606,"tag":636,"props":6194,"children":6195},{"style":648},[6196],{"type":612,"value":4824},{"type":606,"tag":636,"props":6198,"children":6199},{"style":754},[6200],{"type":612,"value":6201},"'success'\n",{"type":606,"tag":636,"props":6203,"children":6204},{"class":638,"line":450},[6205],{"type":606,"tag":636,"props":6206,"children":6207},{"style":648},[6208],{"type":612,"value":6209},"}\n",{"type":606,"tag":636,"props":6211,"children":6212},{"class":638,"line":459},[6213],{"type":606,"tag":636,"props":6214,"children":6215},{"emptyLinePlaceholder":13},[6216],{"type":612,"value":681},{"type":606,"tag":636,"props":6218,"children":6219},{"class":638,"line":468},[6220,6225,6229],{"type":606,"tag":636,"props":6221,"children":6222},{"style":648},[6223],{"type":612,"value":6224},"parsed ",{"type":606,"tag":636,"props":6226,"children":6227},{"style":642},[6228],{"type":612,"value":703},{"type":606,"tag":636,"props":6230,"children":6231},{"style":648},[6232],{"type":612,"value":6233}," parse_api_response(response)\n",{"type":606,"tag":636,"props":6235,"children":6236},{"class":638,"line":477},[6237,6241,6245,6249,6254,6259],{"type":606,"tag":636,"props":6238,"children":6239},{"style":738},[6240],{"type":612,"value":741},{"type":606,"tag":636,"props":6242,"children":6243},{"style":648},[6244],{"type":612,"value":746},{"type":606,"tag":636,"props":6246,"children":6247},{"style":754},[6248],{"type":612,"value":777},{"type":606,"tag":636,"props":6250,"children":6251},{"style":738},[6252],{"type":612,"value":6253},"\\n",{"type":606,"tag":636,"props":6255,"children":6256},{"style":754},[6257],{"type":612,"value":6258},"Parsed Response:\"",{"type":606,"tag":636,"props":6260,"children":6261},{"style":648},[6262],{"type":612,"value":782},{"type":606,"tag":636,"props":6264,"children":6265},{"class":638,"line":488},[6266,6270,6275,6279],{"type":606,"tag":636,"props":6267,"children":6268},{"style":642},[6269],{"type":612,"value":3235},{"type":606,"tag":636,"props":6271,"children":6272},{"style":648},[6273],{"type":612,"value":6274}," key, value ",{"type":606,"tag":636,"props":6276,"children":6277},{"style":642},[6278],{"type":612,"value":3245},{"type":606,"tag":636,"props":6280,"children":6281},{"style":648},[6282],{"type":612,"value":6283}," parsed.items():\n",{"type":606,"tag":636,"props":6285,"children":6286},{"class":638,"line":497},[6287,6291,6295,6299,6303,6307,6312,6316,6320,6324,6329,6333,6337],{"type":606,"tag":636,"props":6288,"children":6289},{"style":738},[6290],{"type":612,"value":5124},{"type":606,"tag":636,"props":6292,"children":6293},{"style":648},[6294],{"type":612,"value":746},{"type":606,"tag":636,"props":6296,"children":6297},{"style":642},[6298],{"type":612,"value":751},{"type":606,"tag":636,"props":6300,"children":6301},{"style":754},[6302],{"type":612,"value":777},{"type":606,"tag":636,"props":6304,"children":6305},{"style":738},[6306],{"type":612,"value":762},{"type":606,"tag":636,"props":6308,"children":6309},{"style":648},[6310],{"type":612,"value":6311},"key",{"type":606,"tag":636,"props":6313,"children":6314},{"style":738},[6315],{"type":612,"value":772},{"type":606,"tag":636,"props":6317,"children":6318},{"style":754},[6319],{"type":612,"value":4824},{"type":606,"tag":636,"props":6321,"children":6322},{"style":738},[6323],{"type":612,"value":762},{"type":606,"tag":636,"props":6325,"children":6326},{"style":648},[6327],{"type":612,"value":6328},"value",{"type":606,"tag":636,"props":6330,"children":6331},{"style":738},[6332],{"type":612,"value":772},{"type":606,"tag":636,"props":6334,"children":6335},{"style":754},[6336],{"type":612,"value":777},{"type":606,"tag":636,"props":6338,"children":6339},{"style":648},[6340],{"type":612,"value":782},{"type":606,"tag":1062,"props":6342,"children":6344},{"id":6343},"key-takeaways",[6345],{"type":612,"value":6346},"🎯 Key Takeaways",{"type":606,"tag":1074,"props":6348,"children":6351},{"emoji":6349,"title":1077,"type":6350},"📚","success",[6352,6360,6400,6408,6431,6439,6467,6475,6493],{"type":606,"tag":615,"props":6353,"children":6354},{},[6355],{"type":606,"tag":1084,"props":6356,"children":6357},{},[6358],{"type":612,"value":6359},"Core Operations:",{"type":606,"tag":1090,"props":6361,"children":6362},{},[6363,6373,6384,6395],{"type":606,"tag":1094,"props":6364,"children":6365},{},[6366,6371],{"type":606,"tag":632,"props":6367,"children":6369},{"className":6368},[],[6370],{"type":612,"value":5275},{"type":612,"value":6372},": Current timestamp (seconds)",{"type":606,"tag":1094,"props":6374,"children":6375},{},[6376,6382],{"type":606,"tag":632,"props":6377,"children":6379},{"className":6378},[],[6380],{"type":612,"value":6381},"datetime.timestamp()",{"type":612,"value":6383},": Convert datetime to timestamp",{"type":606,"tag":1094,"props":6385,"children":6386},{},[6387,6393],{"type":606,"tag":632,"props":6388,"children":6390},{"className":6389},[],[6391],{"type":612,"value":6392},"datetime.fromtimestamp()",{"type":612,"value":6394},": Convert timestamp to datetime",{"type":606,"tag":1094,"props":6396,"children":6397},{},[6398],{"type":612,"value":6399},"Multiply/divide by 1000 for milliseconds",{"type":606,"tag":615,"props":6401,"children":6402},{},[6403],{"type":606,"tag":1084,"props":6404,"children":6405},{},[6406],{"type":612,"value":6407},"Best Practices:",{"type":606,"tag":1090,"props":6409,"children":6410},{},[6411,6416,6421,6426],{"type":606,"tag":1094,"props":6412,"children":6413},{},[6414],{"type":612,"value":6415},"Store timestamps in UTC when possible",{"type":606,"tag":1094,"props":6417,"children":6418},{},[6419],{"type":612,"value":6420},"Use milliseconds for API compatibility",{"type":606,"tag":1094,"props":6422,"children":6423},{},[6424],{"type":612,"value":6425},"Validate timestamp ranges",{"type":606,"tag":1094,"props":6427,"children":6428},{},[6429],{"type":612,"value":6430},"Handle both seconds and milliseconds formats",{"type":606,"tag":615,"props":6432,"children":6433},{},[6434],{"type":606,"tag":1084,"props":6435,"children":6436},{},[6437],{"type":612,"value":6438},"Common Use Cases:",{"type":606,"tag":1090,"props":6440,"children":6441},{},[6442,6447,6452,6457,6462],{"type":606,"tag":1094,"props":6443,"children":6444},{},[6445],{"type":612,"value":6446},"Performance monitoring",{"type":606,"tag":1094,"props":6448,"children":6449},{},[6450],{"type":612,"value":6451},"Data logging",{"type":606,"tag":1094,"props":6453,"children":6454},{},[6455],{"type":612,"value":6456},"API integration",{"type":606,"tag":1094,"props":6458,"children":6459},{},[6460],{"type":612,"value":6461},"Database storage",{"type":606,"tag":1094,"props":6463,"children":6464},{},[6465],{"type":612,"value":6466},"Event tracking",{"type":606,"tag":615,"props":6468,"children":6469},{},[6470],{"type":606,"tag":1084,"props":6471,"children":6472},{},[6473],{"type":612,"value":6474},"Precision Levels:",{"type":606,"tag":1090,"props":6476,"children":6477},{},[6478,6483,6488],{"type":606,"tag":1094,"props":6479,"children":6480},{},[6481],{"type":612,"value":6482},"Seconds: General use",{"type":606,"tag":1094,"props":6484,"children":6485},{},[6486],{"type":612,"value":6487},"Milliseconds: Web APIs",{"type":606,"tag":1094,"props":6489,"children":6490},{},[6491],{"type":612,"value":6492},"Microseconds: High precision timing",{"type":606,"tag":615,"props":6494,"children":6495},{},[6496,6501],{"type":606,"tag":1084,"props":6497,"children":6498},{},[6499],{"type":612,"value":6500},"Remember:",{"type":612,"value":6502}," Timestamps are always UTC - convert to local time for display!",{"type":606,"tag":1062,"props":6504,"children":6506},{"id":6505},"whats-next",[6507],{"type":612,"value":6508},"🚀 What's Next?",{"type":606,"tag":615,"props":6510,"children":6511},{},[6512],{"type":612,"value":6513},"Congratulations! You've mastered Python's date and time operations. Now you're ready to tackle error handling and debugging techniques.",{"type":606,"tag":615,"props":6515,"children":6516},{},[6517,6522,6523,6528],{"type":606,"tag":1084,"props":6518,"children":6519},{},[6520],{"type":612,"value":6521},"Continue to",{"type":612,"value":4824},{"type":606,"tag":6524,"props":6525,"children":6526},"a",{"href":352},[6527],{"type":612,"value":353},{"type":612,"value":6529}," to learn how to make your code robust and maintainable.",{"type":606,"tag":6531,"props":6532,"children":6533},"style",{},[6534],{"type":612,"value":6535},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":6537},[6538,6543,6548,6552,6553],{"id":1064,"depth":27,"text":1067,"children":6539},[6540,6541,6542],{"id":1168,"depth":36,"text":1171},{"id":1582,"depth":36,"text":1585},{"id":2139,"depth":36,"text":2142},{"id":2604,"depth":27,"text":2607,"children":6544},[6545,6546,6547],{"id":2615,"depth":36,"text":2618},{"id":3410,"depth":36,"text":3413},{"id":4136,"depth":36,"text":4139},{"id":5197,"depth":27,"text":5200,"children":6549},[6550,6551],{"id":5203,"depth":36,"text":5206},{"id":5371,"depth":36,"text":5374},{"id":6343,"depth":27,"text":6346},{"id":6505,"depth":27,"text":6508},1782373759014]