[{"data":1,"prerenderedAt":7038},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/calculate-date-differences":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",[315],{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"body":602,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},{"type":603,"children":604,"toc":7019},"root",[605,614,629,941,948,953,1118,1125,1550,1556,2121,2127,2574,2580,2585,2591,3517,3523,4231,4237,5016,5022,5027,5033,5766,5772,6644,6650,6836,6842,6988,6994,6999,7013],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"️-calculating-date-differences",[611],{"type":612,"value":613},"text","⏱️ Calculating Date Differences",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618,620,627],{"type":612,"value":619},"Calculating differences between dates and times is essential for scheduling, analytics, and understanding time spans. Python's ",{"type":606,"tag":621,"props":622,"children":624},"code",{"className":623},[],[625],{"type":612,"value":626},"timedelta",{"type":612,"value":628}," class makes it easy to work with durations and perform date arithmetic.",{"type":606,"tag":630,"props":631,"children":632},"code-try",{},[633],{"type":606,"tag":634,"props":635,"children":639},"pre",{"className":636,"code":637,"language":638,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","from datetime import datetime, timedelta\n\n# Calculate difference between two dates\nstart_date = datetime(2024, 1, 1)\nend_date = datetime(2024, 3, 15)\n\ndifference = end_date - start_date\nprint(f\"Difference: {difference}\")\nprint(f\"Days: {difference.days}\")\nprint(f\"Total seconds: {difference.total_seconds()}\")\n","python",[640],{"type":606,"tag":621,"props":641,"children":642},{"__ignoreMap":8},[643,670,678,687,734,776,783,810,858,900],{"type":606,"tag":644,"props":645,"children":647},"span",{"class":646,"line":12},"line",[648,654,660,665],{"type":606,"tag":644,"props":649,"children":651},{"style":650},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[652],{"type":612,"value":653},"from",{"type":606,"tag":644,"props":655,"children":657},{"style":656},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[658],{"type":612,"value":659}," datetime ",{"type":606,"tag":644,"props":661,"children":662},{"style":650},[663],{"type":612,"value":664},"import",{"type":606,"tag":644,"props":666,"children":667},{"style":656},[668],{"type":612,"value":669}," datetime, timedelta\n",{"type":606,"tag":644,"props":671,"children":672},{"class":646,"line":27},[673],{"type":606,"tag":644,"props":674,"children":675},{"emptyLinePlaceholder":13},[676],{"type":612,"value":677},"\n",{"type":606,"tag":644,"props":679,"children":680},{"class":646,"line":36},[681],{"type":606,"tag":644,"props":682,"children":684},{"style":683},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[685],{"type":612,"value":686},"# Calculate difference between two dates\n",{"type":606,"tag":644,"props":688,"children":689},{"class":646,"line":45},[690,695,700,705,711,716,721,725,729],{"type":606,"tag":644,"props":691,"children":692},{"style":656},[693],{"type":612,"value":694},"start_date ",{"type":606,"tag":644,"props":696,"children":697},{"style":650},[698],{"type":612,"value":699},"=",{"type":606,"tag":644,"props":701,"children":702},{"style":656},[703],{"type":612,"value":704}," datetime(",{"type":606,"tag":644,"props":706,"children":708},{"style":707},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[709],{"type":612,"value":710},"2024",{"type":606,"tag":644,"props":712,"children":713},{"style":656},[714],{"type":612,"value":715},", ",{"type":606,"tag":644,"props":717,"children":718},{"style":707},[719],{"type":612,"value":720},"1",{"type":606,"tag":644,"props":722,"children":723},{"style":656},[724],{"type":612,"value":715},{"type":606,"tag":644,"props":726,"children":727},{"style":707},[728],{"type":612,"value":720},{"type":606,"tag":644,"props":730,"children":731},{"style":656},[732],{"type":612,"value":733},")\n",{"type":606,"tag":644,"props":735,"children":736},{"class":646,"line":54},[737,742,746,750,754,758,763,767,772],{"type":606,"tag":644,"props":738,"children":739},{"style":656},[740],{"type":612,"value":741},"end_date ",{"type":606,"tag":644,"props":743,"children":744},{"style":650},[745],{"type":612,"value":699},{"type":606,"tag":644,"props":747,"children":748},{"style":656},[749],{"type":612,"value":704},{"type":606,"tag":644,"props":751,"children":752},{"style":707},[753],{"type":612,"value":710},{"type":606,"tag":644,"props":755,"children":756},{"style":656},[757],{"type":612,"value":715},{"type":606,"tag":644,"props":759,"children":760},{"style":707},[761],{"type":612,"value":762},"3",{"type":606,"tag":644,"props":764,"children":765},{"style":656},[766],{"type":612,"value":715},{"type":606,"tag":644,"props":768,"children":769},{"style":707},[770],{"type":612,"value":771},"15",{"type":606,"tag":644,"props":773,"children":774},{"style":656},[775],{"type":612,"value":733},{"type":606,"tag":644,"props":777,"children":778},{"class":646,"line":63},[779],{"type":606,"tag":644,"props":780,"children":781},{"emptyLinePlaceholder":13},[782],{"type":612,"value":677},{"type":606,"tag":644,"props":784,"children":785},{"class":646,"line":72},[786,791,795,800,805],{"type":606,"tag":644,"props":787,"children":788},{"style":656},[789],{"type":612,"value":790},"difference ",{"type":606,"tag":644,"props":792,"children":793},{"style":650},[794],{"type":612,"value":699},{"type":606,"tag":644,"props":796,"children":797},{"style":656},[798],{"type":612,"value":799}," end_date ",{"type":606,"tag":644,"props":801,"children":802},{"style":650},[803],{"type":612,"value":804},"-",{"type":606,"tag":644,"props":806,"children":807},{"style":656},[808],{"type":612,"value":809}," start_date\n",{"type":606,"tag":644,"props":811,"children":812},{"class":646,"line":81},[813,818,823,828,834,839,844,849,854],{"type":606,"tag":644,"props":814,"children":815},{"style":707},[816],{"type":612,"value":817},"print",{"type":606,"tag":644,"props":819,"children":820},{"style":656},[821],{"type":612,"value":822},"(",{"type":606,"tag":644,"props":824,"children":825},{"style":650},[826],{"type":612,"value":827},"f",{"type":606,"tag":644,"props":829,"children":831},{"style":830},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[832],{"type":612,"value":833},"\"Difference: ",{"type":606,"tag":644,"props":835,"children":836},{"style":707},[837],{"type":612,"value":838},"{",{"type":606,"tag":644,"props":840,"children":841},{"style":656},[842],{"type":612,"value":843},"difference",{"type":606,"tag":644,"props":845,"children":846},{"style":707},[847],{"type":612,"value":848},"}",{"type":606,"tag":644,"props":850,"children":851},{"style":830},[852],{"type":612,"value":853},"\"",{"type":606,"tag":644,"props":855,"children":856},{"style":656},[857],{"type":612,"value":733},{"type":606,"tag":644,"props":859,"children":861},{"class":646,"line":860},9,[862,866,870,874,879,883,888,892,896],{"type":606,"tag":644,"props":863,"children":864},{"style":707},[865],{"type":612,"value":817},{"type":606,"tag":644,"props":867,"children":868},{"style":656},[869],{"type":612,"value":822},{"type":606,"tag":644,"props":871,"children":872},{"style":650},[873],{"type":612,"value":827},{"type":606,"tag":644,"props":875,"children":876},{"style":830},[877],{"type":612,"value":878},"\"Days: ",{"type":606,"tag":644,"props":880,"children":881},{"style":707},[882],{"type":612,"value":838},{"type":606,"tag":644,"props":884,"children":885},{"style":656},[886],{"type":612,"value":887},"difference.days",{"type":606,"tag":644,"props":889,"children":890},{"style":707},[891],{"type":612,"value":848},{"type":606,"tag":644,"props":893,"children":894},{"style":830},[895],{"type":612,"value":853},{"type":606,"tag":644,"props":897,"children":898},{"style":656},[899],{"type":612,"value":733},{"type":606,"tag":644,"props":901,"children":902},{"class":646,"line":99},[903,907,911,915,920,924,929,933,937],{"type":606,"tag":644,"props":904,"children":905},{"style":707},[906],{"type":612,"value":817},{"type":606,"tag":644,"props":908,"children":909},{"style":656},[910],{"type":612,"value":822},{"type":606,"tag":644,"props":912,"children":913},{"style":650},[914],{"type":612,"value":827},{"type":606,"tag":644,"props":916,"children":917},{"style":830},[918],{"type":612,"value":919},"\"Total seconds: ",{"type":606,"tag":644,"props":921,"children":922},{"style":707},[923],{"type":612,"value":838},{"type":606,"tag":644,"props":925,"children":926},{"style":656},[927],{"type":612,"value":928},"difference.total_seconds()",{"type":606,"tag":644,"props":930,"children":931},{"style":707},[932],{"type":612,"value":848},{"type":606,"tag":644,"props":934,"children":935},{"style":830},[936],{"type":612,"value":853},{"type":606,"tag":644,"props":938,"children":939},{"style":656},[940],{"type":612,"value":733},{"type":606,"tag":942,"props":943,"children":945},"h2",{"id":944},"understanding-timedelta",[946],{"type":612,"value":947},"🎯 Understanding Timedelta",{"type":606,"tag":615,"props":949,"children":950},{},[951],{"type":612,"value":952},"Timedelta represents a duration - the difference between two dates or times.",{"type":606,"tag":954,"props":955,"children":959},"info-box",{"emoji":956,"title":957,"type":958},"⏱️","Timedelta Components","info",[960,969,1007,1015,1085,1093],{"type":606,"tag":615,"props":961,"children":962},{},[963],{"type":606,"tag":964,"props":965,"children":966},"strong",{},[967],{"type":612,"value":968},"Components:",{"type":606,"tag":970,"props":971,"children":972},"ul",{},[973,985,996],{"type":606,"tag":974,"props":975,"children":976},"li",{},[977,983],{"type":606,"tag":621,"props":978,"children":980},{"className":979},[],[981],{"type":612,"value":982},"days",{"type":612,"value":984},": Number of days",{"type":606,"tag":974,"props":986,"children":987},{},[988,994],{"type":606,"tag":621,"props":989,"children":991},{"className":990},[],[992],{"type":612,"value":993},"seconds",{"type":612,"value":995},": Number of seconds (within a day)",{"type":606,"tag":974,"props":997,"children":998},{},[999,1005],{"type":606,"tag":621,"props":1000,"children":1002},{"className":1001},[],[1003],{"type":612,"value":1004},"microseconds",{"type":612,"value":1006},": Number of microseconds",{"type":606,"tag":615,"props":1008,"children":1009},{},[1010],{"type":606,"tag":964,"props":1011,"children":1012},{},[1013],{"type":612,"value":1014},"Methods:",{"type":606,"tag":970,"props":1016,"children":1017},{},[1018,1029,1060],{"type":606,"tag":974,"props":1019,"children":1020},{},[1021,1027],{"type":606,"tag":621,"props":1022,"children":1024},{"className":1023},[],[1025],{"type":612,"value":1026},"total_seconds()",{"type":612,"value":1028},": Total duration in seconds",{"type":606,"tag":974,"props":1030,"children":1031},{},[1032,1034,1040,1041,1046,1047,1053,1054],{"type":612,"value":1033},"Arithmetic operations: ",{"type":606,"tag":621,"props":1035,"children":1037},{"className":1036},[],[1038],{"type":612,"value":1039},"+",{"type":612,"value":715},{"type":606,"tag":621,"props":1042,"children":1044},{"className":1043},[],[1045],{"type":612,"value":804},{"type":612,"value":715},{"type":606,"tag":621,"props":1048,"children":1050},{"className":1049},[],[1051],{"type":612,"value":1052},"*",{"type":612,"value":715},{"type":606,"tag":621,"props":1055,"children":1057},{"className":1056},[],[1058],{"type":612,"value":1059},"/",{"type":606,"tag":974,"props":1061,"children":1062},{},[1063,1065,1071,1072,1078,1079],{"type":612,"value":1064},"Comparison operations: ",{"type":606,"tag":621,"props":1066,"children":1068},{"className":1067},[],[1069],{"type":612,"value":1070},"==",{"type":612,"value":715},{"type":606,"tag":621,"props":1073,"children":1075},{"className":1074},[],[1076],{"type":612,"value":1077},"\u003C",{"type":612,"value":715},{"type":606,"tag":621,"props":1080,"children":1082},{"className":1081},[],[1083],{"type":612,"value":1084},">",{"type":606,"tag":615,"props":1086,"children":1087},{},[1088],{"type":606,"tag":964,"props":1089,"children":1090},{},[1091],{"type":612,"value":1092},"Creation:",{"type":606,"tag":970,"props":1094,"children":1095},{},[1096,1107],{"type":606,"tag":974,"props":1097,"children":1098},{},[1099,1101],{"type":612,"value":1100},"From date subtraction: ",{"type":606,"tag":621,"props":1102,"children":1104},{"className":1103},[],[1105],{"type":612,"value":1106},"date2 - date1",{"type":606,"tag":974,"props":1108,"children":1109},{},[1110,1112],{"type":612,"value":1111},"Direct creation: ",{"type":606,"tag":621,"props":1113,"children":1115},{"className":1114},[],[1116],{"type":612,"value":1117},"timedelta(days=7, hours=2)",{"type":606,"tag":1119,"props":1120,"children":1122},"h3",{"id":1121},"basic-date-arithmetic",[1123],{"type":612,"value":1124},"Basic Date Arithmetic",{"type":606,"tag":630,"props":1126,"children":1127},{},[1128],{"type":606,"tag":634,"props":1129,"children":1131},{"className":636,"code":1130,"language":638,"meta":8,"style":8},"from datetime import datetime, timedelta\n\nnow = datetime.now()\nprint(f\"Current time: {now}\")\n\n# Add time\nfuture = now + timedelta(days=7, hours=3, minutes=30)\nprint(f\"In 7 days, 3 hours, 30 minutes: {future}\")\n\n# Subtract time\npast = now - timedelta(weeks=2, days=3)\nprint(f\"2 weeks and 3 days ago: {past}\")\n\n# Calculate difference\ndiff = future - now\nprint(f\"Time until future: {diff}\")\n",[1132],{"type":606,"tag":621,"props":1133,"children":1134},{"__ignoreMap":8},[1135,1154,1161,1178,1219,1226,1234,1313,1354,1361,1369,1427,1468,1475,1483,1509],{"type":606,"tag":644,"props":1136,"children":1137},{"class":646,"line":12},[1138,1142,1146,1150],{"type":606,"tag":644,"props":1139,"children":1140},{"style":650},[1141],{"type":612,"value":653},{"type":606,"tag":644,"props":1143,"children":1144},{"style":656},[1145],{"type":612,"value":659},{"type":606,"tag":644,"props":1147,"children":1148},{"style":650},[1149],{"type":612,"value":664},{"type":606,"tag":644,"props":1151,"children":1152},{"style":656},[1153],{"type":612,"value":669},{"type":606,"tag":644,"props":1155,"children":1156},{"class":646,"line":27},[1157],{"type":606,"tag":644,"props":1158,"children":1159},{"emptyLinePlaceholder":13},[1160],{"type":612,"value":677},{"type":606,"tag":644,"props":1162,"children":1163},{"class":646,"line":36},[1164,1169,1173],{"type":606,"tag":644,"props":1165,"children":1166},{"style":656},[1167],{"type":612,"value":1168},"now ",{"type":606,"tag":644,"props":1170,"children":1171},{"style":650},[1172],{"type":612,"value":699},{"type":606,"tag":644,"props":1174,"children":1175},{"style":656},[1176],{"type":612,"value":1177}," datetime.now()\n",{"type":606,"tag":644,"props":1179,"children":1180},{"class":646,"line":45},[1181,1185,1189,1193,1198,1202,1207,1211,1215],{"type":606,"tag":644,"props":1182,"children":1183},{"style":707},[1184],{"type":612,"value":817},{"type":606,"tag":644,"props":1186,"children":1187},{"style":656},[1188],{"type":612,"value":822},{"type":606,"tag":644,"props":1190,"children":1191},{"style":650},[1192],{"type":612,"value":827},{"type":606,"tag":644,"props":1194,"children":1195},{"style":830},[1196],{"type":612,"value":1197},"\"Current time: ",{"type":606,"tag":644,"props":1199,"children":1200},{"style":707},[1201],{"type":612,"value":838},{"type":606,"tag":644,"props":1203,"children":1204},{"style":656},[1205],{"type":612,"value":1206},"now",{"type":606,"tag":644,"props":1208,"children":1209},{"style":707},[1210],{"type":612,"value":848},{"type":606,"tag":644,"props":1212,"children":1213},{"style":830},[1214],{"type":612,"value":853},{"type":606,"tag":644,"props":1216,"children":1217},{"style":656},[1218],{"type":612,"value":733},{"type":606,"tag":644,"props":1220,"children":1221},{"class":646,"line":54},[1222],{"type":606,"tag":644,"props":1223,"children":1224},{"emptyLinePlaceholder":13},[1225],{"type":612,"value":677},{"type":606,"tag":644,"props":1227,"children":1228},{"class":646,"line":63},[1229],{"type":606,"tag":644,"props":1230,"children":1231},{"style":683},[1232],{"type":612,"value":1233},"# Add time\n",{"type":606,"tag":644,"props":1235,"children":1236},{"class":646,"line":72},[1237,1242,1246,1251,1255,1260,1265,1269,1274,1278,1283,1287,1291,1295,1300,1304,1309],{"type":606,"tag":644,"props":1238,"children":1239},{"style":656},[1240],{"type":612,"value":1241},"future ",{"type":606,"tag":644,"props":1243,"children":1244},{"style":650},[1245],{"type":612,"value":699},{"type":606,"tag":644,"props":1247,"children":1248},{"style":656},[1249],{"type":612,"value":1250}," now ",{"type":606,"tag":644,"props":1252,"children":1253},{"style":650},[1254],{"type":612,"value":1039},{"type":606,"tag":644,"props":1256,"children":1257},{"style":656},[1258],{"type":612,"value":1259}," timedelta(",{"type":606,"tag":644,"props":1261,"children":1263},{"style":1262},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[1264],{"type":612,"value":982},{"type":606,"tag":644,"props":1266,"children":1267},{"style":650},[1268],{"type":612,"value":699},{"type":606,"tag":644,"props":1270,"children":1271},{"style":707},[1272],{"type":612,"value":1273},"7",{"type":606,"tag":644,"props":1275,"children":1276},{"style":656},[1277],{"type":612,"value":715},{"type":606,"tag":644,"props":1279,"children":1280},{"style":1262},[1281],{"type":612,"value":1282},"hours",{"type":606,"tag":644,"props":1284,"children":1285},{"style":650},[1286],{"type":612,"value":699},{"type":606,"tag":644,"props":1288,"children":1289},{"style":707},[1290],{"type":612,"value":762},{"type":606,"tag":644,"props":1292,"children":1293},{"style":656},[1294],{"type":612,"value":715},{"type":606,"tag":644,"props":1296,"children":1297},{"style":1262},[1298],{"type":612,"value":1299},"minutes",{"type":606,"tag":644,"props":1301,"children":1302},{"style":650},[1303],{"type":612,"value":699},{"type":606,"tag":644,"props":1305,"children":1306},{"style":707},[1307],{"type":612,"value":1308},"30",{"type":606,"tag":644,"props":1310,"children":1311},{"style":656},[1312],{"type":612,"value":733},{"type":606,"tag":644,"props":1314,"children":1315},{"class":646,"line":81},[1316,1320,1324,1328,1333,1337,1342,1346,1350],{"type":606,"tag":644,"props":1317,"children":1318},{"style":707},[1319],{"type":612,"value":817},{"type":606,"tag":644,"props":1321,"children":1322},{"style":656},[1323],{"type":612,"value":822},{"type":606,"tag":644,"props":1325,"children":1326},{"style":650},[1327],{"type":612,"value":827},{"type":606,"tag":644,"props":1329,"children":1330},{"style":830},[1331],{"type":612,"value":1332},"\"In 7 days, 3 hours, 30 minutes: ",{"type":606,"tag":644,"props":1334,"children":1335},{"style":707},[1336],{"type":612,"value":838},{"type":606,"tag":644,"props":1338,"children":1339},{"style":656},[1340],{"type":612,"value":1341},"future",{"type":606,"tag":644,"props":1343,"children":1344},{"style":707},[1345],{"type":612,"value":848},{"type":606,"tag":644,"props":1347,"children":1348},{"style":830},[1349],{"type":612,"value":853},{"type":606,"tag":644,"props":1351,"children":1352},{"style":656},[1353],{"type":612,"value":733},{"type":606,"tag":644,"props":1355,"children":1356},{"class":646,"line":860},[1357],{"type":606,"tag":644,"props":1358,"children":1359},{"emptyLinePlaceholder":13},[1360],{"type":612,"value":677},{"type":606,"tag":644,"props":1362,"children":1363},{"class":646,"line":99},[1364],{"type":606,"tag":644,"props":1365,"children":1366},{"style":683},[1367],{"type":612,"value":1368},"# Subtract time\n",{"type":606,"tag":644,"props":1370,"children":1371},{"class":646,"line":108},[1372,1377,1381,1385,1389,1393,1398,1402,1407,1411,1415,1419,1423],{"type":606,"tag":644,"props":1373,"children":1374},{"style":656},[1375],{"type":612,"value":1376},"past ",{"type":606,"tag":644,"props":1378,"children":1379},{"style":650},[1380],{"type":612,"value":699},{"type":606,"tag":644,"props":1382,"children":1383},{"style":656},[1384],{"type":612,"value":1250},{"type":606,"tag":644,"props":1386,"children":1387},{"style":650},[1388],{"type":612,"value":804},{"type":606,"tag":644,"props":1390,"children":1391},{"style":656},[1392],{"type":612,"value":1259},{"type":606,"tag":644,"props":1394,"children":1395},{"style":1262},[1396],{"type":612,"value":1397},"weeks",{"type":606,"tag":644,"props":1399,"children":1400},{"style":650},[1401],{"type":612,"value":699},{"type":606,"tag":644,"props":1403,"children":1404},{"style":707},[1405],{"type":612,"value":1406},"2",{"type":606,"tag":644,"props":1408,"children":1409},{"style":656},[1410],{"type":612,"value":715},{"type":606,"tag":644,"props":1412,"children":1413},{"style":1262},[1414],{"type":612,"value":982},{"type":606,"tag":644,"props":1416,"children":1417},{"style":650},[1418],{"type":612,"value":699},{"type":606,"tag":644,"props":1420,"children":1421},{"style":707},[1422],{"type":612,"value":762},{"type":606,"tag":644,"props":1424,"children":1425},{"style":656},[1426],{"type":612,"value":733},{"type":606,"tag":644,"props":1428,"children":1429},{"class":646,"line":117},[1430,1434,1438,1442,1447,1451,1456,1460,1464],{"type":606,"tag":644,"props":1431,"children":1432},{"style":707},[1433],{"type":612,"value":817},{"type":606,"tag":644,"props":1435,"children":1436},{"style":656},[1437],{"type":612,"value":822},{"type":606,"tag":644,"props":1439,"children":1440},{"style":650},[1441],{"type":612,"value":827},{"type":606,"tag":644,"props":1443,"children":1444},{"style":830},[1445],{"type":612,"value":1446},"\"2 weeks and 3 days ago: ",{"type":606,"tag":644,"props":1448,"children":1449},{"style":707},[1450],{"type":612,"value":838},{"type":606,"tag":644,"props":1452,"children":1453},{"style":656},[1454],{"type":612,"value":1455},"past",{"type":606,"tag":644,"props":1457,"children":1458},{"style":707},[1459],{"type":612,"value":848},{"type":606,"tag":644,"props":1461,"children":1462},{"style":830},[1463],{"type":612,"value":853},{"type":606,"tag":644,"props":1465,"children":1466},{"style":656},[1467],{"type":612,"value":733},{"type":606,"tag":644,"props":1469,"children":1470},{"class":646,"line":126},[1471],{"type":606,"tag":644,"props":1472,"children":1473},{"emptyLinePlaceholder":13},[1474],{"type":612,"value":677},{"type":606,"tag":644,"props":1476,"children":1477},{"class":646,"line":135},[1478],{"type":606,"tag":644,"props":1479,"children":1480},{"style":683},[1481],{"type":612,"value":1482},"# Calculate difference\n",{"type":606,"tag":644,"props":1484,"children":1485},{"class":646,"line":144},[1486,1491,1495,1500,1504],{"type":606,"tag":644,"props":1487,"children":1488},{"style":656},[1489],{"type":612,"value":1490},"diff ",{"type":606,"tag":644,"props":1492,"children":1493},{"style":650},[1494],{"type":612,"value":699},{"type":606,"tag":644,"props":1496,"children":1497},{"style":656},[1498],{"type":612,"value":1499}," future ",{"type":606,"tag":644,"props":1501,"children":1502},{"style":650},[1503],{"type":612,"value":804},{"type":606,"tag":644,"props":1505,"children":1506},{"style":656},[1507],{"type":612,"value":1508}," now\n",{"type":606,"tag":644,"props":1510,"children":1511},{"class":646,"line":153},[1512,1516,1520,1524,1529,1533,1538,1542,1546],{"type":606,"tag":644,"props":1513,"children":1514},{"style":707},[1515],{"type":612,"value":817},{"type":606,"tag":644,"props":1517,"children":1518},{"style":656},[1519],{"type":612,"value":822},{"type":606,"tag":644,"props":1521,"children":1522},{"style":650},[1523],{"type":612,"value":827},{"type":606,"tag":644,"props":1525,"children":1526},{"style":830},[1527],{"type":612,"value":1528},"\"Time until future: ",{"type":606,"tag":644,"props":1530,"children":1531},{"style":707},[1532],{"type":612,"value":838},{"type":606,"tag":644,"props":1534,"children":1535},{"style":656},[1536],{"type":612,"value":1537},"diff",{"type":606,"tag":644,"props":1539,"children":1540},{"style":707},[1541],{"type":612,"value":848},{"type":606,"tag":644,"props":1543,"children":1544},{"style":830},[1545],{"type":612,"value":853},{"type":606,"tag":644,"props":1547,"children":1548},{"style":656},[1549],{"type":612,"value":733},{"type":606,"tag":1119,"props":1551,"children":1553},{"id":1552},"creating-timedelta-objects",[1554],{"type":612,"value":1555},"Creating Timedelta Objects",{"type":606,"tag":630,"props":1557,"children":1558},{},[1559],{"type":606,"tag":634,"props":1560,"children":1562},{"className":636,"code":1561,"language":638,"meta":8,"style":8},"from datetime import timedelta\n\n# Different ways to create timedelta\none_week = timedelta(weeks=1)\none_day = timedelta(days=1)\none_hour = timedelta(hours=1)\nthirty_minutes = timedelta(minutes=30)\ncombined = timedelta(days=5, hours=8, minutes=30, seconds=45)\n\nprint(f\"One week: {one_week}\")\nprint(f\"One day: {one_day}\")\nprint(f\"One hour: {one_hour}\")\nprint(f\"Thirty minutes: {thirty_minutes}\")\nprint(f\"Combined: {combined}\")\n\n# Get total seconds for different durations\nprint(f\"Week in seconds: {one_week.total_seconds()}\")\nprint(f\"Day in seconds: {one_day.total_seconds()}\")\n",[1563],{"type":606,"tag":621,"props":1564,"children":1565},{"__ignoreMap":8},[1566,1586,1593,1601,1633,1665,1697,1729,1812,1819,1860,1901,1942,1983,2024,2031,2039,2080],{"type":606,"tag":644,"props":1567,"children":1568},{"class":646,"line":12},[1569,1573,1577,1581],{"type":606,"tag":644,"props":1570,"children":1571},{"style":650},[1572],{"type":612,"value":653},{"type":606,"tag":644,"props":1574,"children":1575},{"style":656},[1576],{"type":612,"value":659},{"type":606,"tag":644,"props":1578,"children":1579},{"style":650},[1580],{"type":612,"value":664},{"type":606,"tag":644,"props":1582,"children":1583},{"style":656},[1584],{"type":612,"value":1585}," timedelta\n",{"type":606,"tag":644,"props":1587,"children":1588},{"class":646,"line":27},[1589],{"type":606,"tag":644,"props":1590,"children":1591},{"emptyLinePlaceholder":13},[1592],{"type":612,"value":677},{"type":606,"tag":644,"props":1594,"children":1595},{"class":646,"line":36},[1596],{"type":606,"tag":644,"props":1597,"children":1598},{"style":683},[1599],{"type":612,"value":1600},"# Different ways to create timedelta\n",{"type":606,"tag":644,"props":1602,"children":1603},{"class":646,"line":45},[1604,1609,1613,1617,1621,1625,1629],{"type":606,"tag":644,"props":1605,"children":1606},{"style":656},[1607],{"type":612,"value":1608},"one_week ",{"type":606,"tag":644,"props":1610,"children":1611},{"style":650},[1612],{"type":612,"value":699},{"type":606,"tag":644,"props":1614,"children":1615},{"style":656},[1616],{"type":612,"value":1259},{"type":606,"tag":644,"props":1618,"children":1619},{"style":1262},[1620],{"type":612,"value":1397},{"type":606,"tag":644,"props":1622,"children":1623},{"style":650},[1624],{"type":612,"value":699},{"type":606,"tag":644,"props":1626,"children":1627},{"style":707},[1628],{"type":612,"value":720},{"type":606,"tag":644,"props":1630,"children":1631},{"style":656},[1632],{"type":612,"value":733},{"type":606,"tag":644,"props":1634,"children":1635},{"class":646,"line":54},[1636,1641,1645,1649,1653,1657,1661],{"type":606,"tag":644,"props":1637,"children":1638},{"style":656},[1639],{"type":612,"value":1640},"one_day ",{"type":606,"tag":644,"props":1642,"children":1643},{"style":650},[1644],{"type":612,"value":699},{"type":606,"tag":644,"props":1646,"children":1647},{"style":656},[1648],{"type":612,"value":1259},{"type":606,"tag":644,"props":1650,"children":1651},{"style":1262},[1652],{"type":612,"value":982},{"type":606,"tag":644,"props":1654,"children":1655},{"style":650},[1656],{"type":612,"value":699},{"type":606,"tag":644,"props":1658,"children":1659},{"style":707},[1660],{"type":612,"value":720},{"type":606,"tag":644,"props":1662,"children":1663},{"style":656},[1664],{"type":612,"value":733},{"type":606,"tag":644,"props":1666,"children":1667},{"class":646,"line":63},[1668,1673,1677,1681,1685,1689,1693],{"type":606,"tag":644,"props":1669,"children":1670},{"style":656},[1671],{"type":612,"value":1672},"one_hour ",{"type":606,"tag":644,"props":1674,"children":1675},{"style":650},[1676],{"type":612,"value":699},{"type":606,"tag":644,"props":1678,"children":1679},{"style":656},[1680],{"type":612,"value":1259},{"type":606,"tag":644,"props":1682,"children":1683},{"style":1262},[1684],{"type":612,"value":1282},{"type":606,"tag":644,"props":1686,"children":1687},{"style":650},[1688],{"type":612,"value":699},{"type":606,"tag":644,"props":1690,"children":1691},{"style":707},[1692],{"type":612,"value":720},{"type":606,"tag":644,"props":1694,"children":1695},{"style":656},[1696],{"type":612,"value":733},{"type":606,"tag":644,"props":1698,"children":1699},{"class":646,"line":72},[1700,1705,1709,1713,1717,1721,1725],{"type":606,"tag":644,"props":1701,"children":1702},{"style":656},[1703],{"type":612,"value":1704},"thirty_minutes ",{"type":606,"tag":644,"props":1706,"children":1707},{"style":650},[1708],{"type":612,"value":699},{"type":606,"tag":644,"props":1710,"children":1711},{"style":656},[1712],{"type":612,"value":1259},{"type":606,"tag":644,"props":1714,"children":1715},{"style":1262},[1716],{"type":612,"value":1299},{"type":606,"tag":644,"props":1718,"children":1719},{"style":650},[1720],{"type":612,"value":699},{"type":606,"tag":644,"props":1722,"children":1723},{"style":707},[1724],{"type":612,"value":1308},{"type":606,"tag":644,"props":1726,"children":1727},{"style":656},[1728],{"type":612,"value":733},{"type":606,"tag":644,"props":1730,"children":1731},{"class":646,"line":81},[1732,1737,1741,1745,1749,1753,1758,1762,1766,1770,1775,1779,1783,1787,1791,1795,1799,1803,1808],{"type":606,"tag":644,"props":1733,"children":1734},{"style":656},[1735],{"type":612,"value":1736},"combined ",{"type":606,"tag":644,"props":1738,"children":1739},{"style":650},[1740],{"type":612,"value":699},{"type":606,"tag":644,"props":1742,"children":1743},{"style":656},[1744],{"type":612,"value":1259},{"type":606,"tag":644,"props":1746,"children":1747},{"style":1262},[1748],{"type":612,"value":982},{"type":606,"tag":644,"props":1750,"children":1751},{"style":650},[1752],{"type":612,"value":699},{"type":606,"tag":644,"props":1754,"children":1755},{"style":707},[1756],{"type":612,"value":1757},"5",{"type":606,"tag":644,"props":1759,"children":1760},{"style":656},[1761],{"type":612,"value":715},{"type":606,"tag":644,"props":1763,"children":1764},{"style":1262},[1765],{"type":612,"value":1282},{"type":606,"tag":644,"props":1767,"children":1768},{"style":650},[1769],{"type":612,"value":699},{"type":606,"tag":644,"props":1771,"children":1772},{"style":707},[1773],{"type":612,"value":1774},"8",{"type":606,"tag":644,"props":1776,"children":1777},{"style":656},[1778],{"type":612,"value":715},{"type":606,"tag":644,"props":1780,"children":1781},{"style":1262},[1782],{"type":612,"value":1299},{"type":606,"tag":644,"props":1784,"children":1785},{"style":650},[1786],{"type":612,"value":699},{"type":606,"tag":644,"props":1788,"children":1789},{"style":707},[1790],{"type":612,"value":1308},{"type":606,"tag":644,"props":1792,"children":1793},{"style":656},[1794],{"type":612,"value":715},{"type":606,"tag":644,"props":1796,"children":1797},{"style":1262},[1798],{"type":612,"value":993},{"type":606,"tag":644,"props":1800,"children":1801},{"style":650},[1802],{"type":612,"value":699},{"type":606,"tag":644,"props":1804,"children":1805},{"style":707},[1806],{"type":612,"value":1807},"45",{"type":606,"tag":644,"props":1809,"children":1810},{"style":656},[1811],{"type":612,"value":733},{"type":606,"tag":644,"props":1813,"children":1814},{"class":646,"line":860},[1815],{"type":606,"tag":644,"props":1816,"children":1817},{"emptyLinePlaceholder":13},[1818],{"type":612,"value":677},{"type":606,"tag":644,"props":1820,"children":1821},{"class":646,"line":99},[1822,1826,1830,1834,1839,1843,1848,1852,1856],{"type":606,"tag":644,"props":1823,"children":1824},{"style":707},[1825],{"type":612,"value":817},{"type":606,"tag":644,"props":1827,"children":1828},{"style":656},[1829],{"type":612,"value":822},{"type":606,"tag":644,"props":1831,"children":1832},{"style":650},[1833],{"type":612,"value":827},{"type":606,"tag":644,"props":1835,"children":1836},{"style":830},[1837],{"type":612,"value":1838},"\"One week: ",{"type":606,"tag":644,"props":1840,"children":1841},{"style":707},[1842],{"type":612,"value":838},{"type":606,"tag":644,"props":1844,"children":1845},{"style":656},[1846],{"type":612,"value":1847},"one_week",{"type":606,"tag":644,"props":1849,"children":1850},{"style":707},[1851],{"type":612,"value":848},{"type":606,"tag":644,"props":1853,"children":1854},{"style":830},[1855],{"type":612,"value":853},{"type":606,"tag":644,"props":1857,"children":1858},{"style":656},[1859],{"type":612,"value":733},{"type":606,"tag":644,"props":1861,"children":1862},{"class":646,"line":108},[1863,1867,1871,1875,1880,1884,1889,1893,1897],{"type":606,"tag":644,"props":1864,"children":1865},{"style":707},[1866],{"type":612,"value":817},{"type":606,"tag":644,"props":1868,"children":1869},{"style":656},[1870],{"type":612,"value":822},{"type":606,"tag":644,"props":1872,"children":1873},{"style":650},[1874],{"type":612,"value":827},{"type":606,"tag":644,"props":1876,"children":1877},{"style":830},[1878],{"type":612,"value":1879},"\"One day: ",{"type":606,"tag":644,"props":1881,"children":1882},{"style":707},[1883],{"type":612,"value":838},{"type":606,"tag":644,"props":1885,"children":1886},{"style":656},[1887],{"type":612,"value":1888},"one_day",{"type":606,"tag":644,"props":1890,"children":1891},{"style":707},[1892],{"type":612,"value":848},{"type":606,"tag":644,"props":1894,"children":1895},{"style":830},[1896],{"type":612,"value":853},{"type":606,"tag":644,"props":1898,"children":1899},{"style":656},[1900],{"type":612,"value":733},{"type":606,"tag":644,"props":1902,"children":1903},{"class":646,"line":117},[1904,1908,1912,1916,1921,1925,1930,1934,1938],{"type":606,"tag":644,"props":1905,"children":1906},{"style":707},[1907],{"type":612,"value":817},{"type":606,"tag":644,"props":1909,"children":1910},{"style":656},[1911],{"type":612,"value":822},{"type":606,"tag":644,"props":1913,"children":1914},{"style":650},[1915],{"type":612,"value":827},{"type":606,"tag":644,"props":1917,"children":1918},{"style":830},[1919],{"type":612,"value":1920},"\"One hour: ",{"type":606,"tag":644,"props":1922,"children":1923},{"style":707},[1924],{"type":612,"value":838},{"type":606,"tag":644,"props":1926,"children":1927},{"style":656},[1928],{"type":612,"value":1929},"one_hour",{"type":606,"tag":644,"props":1931,"children":1932},{"style":707},[1933],{"type":612,"value":848},{"type":606,"tag":644,"props":1935,"children":1936},{"style":830},[1937],{"type":612,"value":853},{"type":606,"tag":644,"props":1939,"children":1940},{"style":656},[1941],{"type":612,"value":733},{"type":606,"tag":644,"props":1943,"children":1944},{"class":646,"line":126},[1945,1949,1953,1957,1962,1966,1971,1975,1979],{"type":606,"tag":644,"props":1946,"children":1947},{"style":707},[1948],{"type":612,"value":817},{"type":606,"tag":644,"props":1950,"children":1951},{"style":656},[1952],{"type":612,"value":822},{"type":606,"tag":644,"props":1954,"children":1955},{"style":650},[1956],{"type":612,"value":827},{"type":606,"tag":644,"props":1958,"children":1959},{"style":830},[1960],{"type":612,"value":1961},"\"Thirty minutes: ",{"type":606,"tag":644,"props":1963,"children":1964},{"style":707},[1965],{"type":612,"value":838},{"type":606,"tag":644,"props":1967,"children":1968},{"style":656},[1969],{"type":612,"value":1970},"thirty_minutes",{"type":606,"tag":644,"props":1972,"children":1973},{"style":707},[1974],{"type":612,"value":848},{"type":606,"tag":644,"props":1976,"children":1977},{"style":830},[1978],{"type":612,"value":853},{"type":606,"tag":644,"props":1980,"children":1981},{"style":656},[1982],{"type":612,"value":733},{"type":606,"tag":644,"props":1984,"children":1985},{"class":646,"line":135},[1986,1990,1994,1998,2003,2007,2012,2016,2020],{"type":606,"tag":644,"props":1987,"children":1988},{"style":707},[1989],{"type":612,"value":817},{"type":606,"tag":644,"props":1991,"children":1992},{"style":656},[1993],{"type":612,"value":822},{"type":606,"tag":644,"props":1995,"children":1996},{"style":650},[1997],{"type":612,"value":827},{"type":606,"tag":644,"props":1999,"children":2000},{"style":830},[2001],{"type":612,"value":2002},"\"Combined: ",{"type":606,"tag":644,"props":2004,"children":2005},{"style":707},[2006],{"type":612,"value":838},{"type":606,"tag":644,"props":2008,"children":2009},{"style":656},[2010],{"type":612,"value":2011},"combined",{"type":606,"tag":644,"props":2013,"children":2014},{"style":707},[2015],{"type":612,"value":848},{"type":606,"tag":644,"props":2017,"children":2018},{"style":830},[2019],{"type":612,"value":853},{"type":606,"tag":644,"props":2021,"children":2022},{"style":656},[2023],{"type":612,"value":733},{"type":606,"tag":644,"props":2025,"children":2026},{"class":646,"line":144},[2027],{"type":606,"tag":644,"props":2028,"children":2029},{"emptyLinePlaceholder":13},[2030],{"type":612,"value":677},{"type":606,"tag":644,"props":2032,"children":2033},{"class":646,"line":153},[2034],{"type":606,"tag":644,"props":2035,"children":2036},{"style":683},[2037],{"type":612,"value":2038},"# Get total seconds for different durations\n",{"type":606,"tag":644,"props":2040,"children":2041},{"class":646,"line":163},[2042,2046,2050,2054,2059,2063,2068,2072,2076],{"type":606,"tag":644,"props":2043,"children":2044},{"style":707},[2045],{"type":612,"value":817},{"type":606,"tag":644,"props":2047,"children":2048},{"style":656},[2049],{"type":612,"value":822},{"type":606,"tag":644,"props":2051,"children":2052},{"style":650},[2053],{"type":612,"value":827},{"type":606,"tag":644,"props":2055,"children":2056},{"style":830},[2057],{"type":612,"value":2058},"\"Week in seconds: ",{"type":606,"tag":644,"props":2060,"children":2061},{"style":707},[2062],{"type":612,"value":838},{"type":606,"tag":644,"props":2064,"children":2065},{"style":656},[2066],{"type":612,"value":2067},"one_week.total_seconds()",{"type":606,"tag":644,"props":2069,"children":2070},{"style":707},[2071],{"type":612,"value":848},{"type":606,"tag":644,"props":2073,"children":2074},{"style":830},[2075],{"type":612,"value":853},{"type":606,"tag":644,"props":2077,"children":2078},{"style":656},[2079],{"type":612,"value":733},{"type":606,"tag":644,"props":2081,"children":2082},{"class":646,"line":172},[2083,2087,2091,2095,2100,2104,2109,2113,2117],{"type":606,"tag":644,"props":2084,"children":2085},{"style":707},[2086],{"type":612,"value":817},{"type":606,"tag":644,"props":2088,"children":2089},{"style":656},[2090],{"type":612,"value":822},{"type":606,"tag":644,"props":2092,"children":2093},{"style":650},[2094],{"type":612,"value":827},{"type":606,"tag":644,"props":2096,"children":2097},{"style":830},[2098],{"type":612,"value":2099},"\"Day in seconds: ",{"type":606,"tag":644,"props":2101,"children":2102},{"style":707},[2103],{"type":612,"value":838},{"type":606,"tag":644,"props":2105,"children":2106},{"style":656},[2107],{"type":612,"value":2108},"one_day.total_seconds()",{"type":606,"tag":644,"props":2110,"children":2111},{"style":707},[2112],{"type":612,"value":848},{"type":606,"tag":644,"props":2114,"children":2115},{"style":830},[2116],{"type":612,"value":853},{"type":606,"tag":644,"props":2118,"children":2119},{"style":656},[2120],{"type":612,"value":733},{"type":606,"tag":1119,"props":2122,"children":2124},{"id":2123},"date-difference-calculations",[2125],{"type":612,"value":2126},"Date Difference Calculations",{"type":606,"tag":630,"props":2128,"children":2129},{},[2130],{"type":606,"tag":634,"props":2131,"children":2133},{"className":636,"code":2132,"language":638,"meta":8,"style":8},"from datetime import datetime, date\n\n# Calculate age in different units\nbirth_date = datetime(1990, 5, 15)\nnow = datetime.now()\n\nage_delta = now - birth_date\nprint(f\"Age in days: {age_delta.days}\")\nprint(f\"Age in years (approx): {age_delta.days // 365}\")\n\n# Calculate project duration\nproject_start = datetime(2024, 1, 15)\nproject_end = datetime(2024, 6, 30)\n\nduration = project_end - project_start\nprint(f\"Project duration: {duration.days} days\")\nprint(f\"Project duration: {duration.days / 7:.1f} weeks\")\n",[2134],{"type":606,"tag":621,"props":2135,"children":2136},{"__ignoreMap":8},[2137,2157,2164,2172,2213,2228,2235,2260,2301,2348,2355,2363,2403,2444,2451,2477,2519],{"type":606,"tag":644,"props":2138,"children":2139},{"class":646,"line":12},[2140,2144,2148,2152],{"type":606,"tag":644,"props":2141,"children":2142},{"style":650},[2143],{"type":612,"value":653},{"type":606,"tag":644,"props":2145,"children":2146},{"style":656},[2147],{"type":612,"value":659},{"type":606,"tag":644,"props":2149,"children":2150},{"style":650},[2151],{"type":612,"value":664},{"type":606,"tag":644,"props":2153,"children":2154},{"style":656},[2155],{"type":612,"value":2156}," datetime, date\n",{"type":606,"tag":644,"props":2158,"children":2159},{"class":646,"line":27},[2160],{"type":606,"tag":644,"props":2161,"children":2162},{"emptyLinePlaceholder":13},[2163],{"type":612,"value":677},{"type":606,"tag":644,"props":2165,"children":2166},{"class":646,"line":36},[2167],{"type":606,"tag":644,"props":2168,"children":2169},{"style":683},[2170],{"type":612,"value":2171},"# Calculate age in different units\n",{"type":606,"tag":644,"props":2173,"children":2174},{"class":646,"line":45},[2175,2180,2184,2188,2193,2197,2201,2205,2209],{"type":606,"tag":644,"props":2176,"children":2177},{"style":656},[2178],{"type":612,"value":2179},"birth_date ",{"type":606,"tag":644,"props":2181,"children":2182},{"style":650},[2183],{"type":612,"value":699},{"type":606,"tag":644,"props":2185,"children":2186},{"style":656},[2187],{"type":612,"value":704},{"type":606,"tag":644,"props":2189,"children":2190},{"style":707},[2191],{"type":612,"value":2192},"1990",{"type":606,"tag":644,"props":2194,"children":2195},{"style":656},[2196],{"type":612,"value":715},{"type":606,"tag":644,"props":2198,"children":2199},{"style":707},[2200],{"type":612,"value":1757},{"type":606,"tag":644,"props":2202,"children":2203},{"style":656},[2204],{"type":612,"value":715},{"type":606,"tag":644,"props":2206,"children":2207},{"style":707},[2208],{"type":612,"value":771},{"type":606,"tag":644,"props":2210,"children":2211},{"style":656},[2212],{"type":612,"value":733},{"type":606,"tag":644,"props":2214,"children":2215},{"class":646,"line":54},[2216,2220,2224],{"type":606,"tag":644,"props":2217,"children":2218},{"style":656},[2219],{"type":612,"value":1168},{"type":606,"tag":644,"props":2221,"children":2222},{"style":650},[2223],{"type":612,"value":699},{"type":606,"tag":644,"props":2225,"children":2226},{"style":656},[2227],{"type":612,"value":1177},{"type":606,"tag":644,"props":2229,"children":2230},{"class":646,"line":63},[2231],{"type":606,"tag":644,"props":2232,"children":2233},{"emptyLinePlaceholder":13},[2234],{"type":612,"value":677},{"type":606,"tag":644,"props":2236,"children":2237},{"class":646,"line":72},[2238,2243,2247,2251,2255],{"type":606,"tag":644,"props":2239,"children":2240},{"style":656},[2241],{"type":612,"value":2242},"age_delta ",{"type":606,"tag":644,"props":2244,"children":2245},{"style":650},[2246],{"type":612,"value":699},{"type":606,"tag":644,"props":2248,"children":2249},{"style":656},[2250],{"type":612,"value":1250},{"type":606,"tag":644,"props":2252,"children":2253},{"style":650},[2254],{"type":612,"value":804},{"type":606,"tag":644,"props":2256,"children":2257},{"style":656},[2258],{"type":612,"value":2259}," birth_date\n",{"type":606,"tag":644,"props":2261,"children":2262},{"class":646,"line":81},[2263,2267,2271,2275,2280,2284,2289,2293,2297],{"type":606,"tag":644,"props":2264,"children":2265},{"style":707},[2266],{"type":612,"value":817},{"type":606,"tag":644,"props":2268,"children":2269},{"style":656},[2270],{"type":612,"value":822},{"type":606,"tag":644,"props":2272,"children":2273},{"style":650},[2274],{"type":612,"value":827},{"type":606,"tag":644,"props":2276,"children":2277},{"style":830},[2278],{"type":612,"value":2279},"\"Age in days: ",{"type":606,"tag":644,"props":2281,"children":2282},{"style":707},[2283],{"type":612,"value":838},{"type":606,"tag":644,"props":2285,"children":2286},{"style":656},[2287],{"type":612,"value":2288},"age_delta.days",{"type":606,"tag":644,"props":2290,"children":2291},{"style":707},[2292],{"type":612,"value":848},{"type":606,"tag":644,"props":2294,"children":2295},{"style":830},[2296],{"type":612,"value":853},{"type":606,"tag":644,"props":2298,"children":2299},{"style":656},[2300],{"type":612,"value":733},{"type":606,"tag":644,"props":2302,"children":2303},{"class":646,"line":860},[2304,2308,2312,2316,2321,2325,2330,2335,2340,2344],{"type":606,"tag":644,"props":2305,"children":2306},{"style":707},[2307],{"type":612,"value":817},{"type":606,"tag":644,"props":2309,"children":2310},{"style":656},[2311],{"type":612,"value":822},{"type":606,"tag":644,"props":2313,"children":2314},{"style":650},[2315],{"type":612,"value":827},{"type":606,"tag":644,"props":2317,"children":2318},{"style":830},[2319],{"type":612,"value":2320},"\"Age in years (approx): ",{"type":606,"tag":644,"props":2322,"children":2323},{"style":707},[2324],{"type":612,"value":838},{"type":606,"tag":644,"props":2326,"children":2327},{"style":656},[2328],{"type":612,"value":2329},"age_delta.days ",{"type":606,"tag":644,"props":2331,"children":2332},{"style":650},[2333],{"type":612,"value":2334},"//",{"type":606,"tag":644,"props":2336,"children":2337},{"style":707},[2338],{"type":612,"value":2339}," 365}",{"type":606,"tag":644,"props":2341,"children":2342},{"style":830},[2343],{"type":612,"value":853},{"type":606,"tag":644,"props":2345,"children":2346},{"style":656},[2347],{"type":612,"value":733},{"type":606,"tag":644,"props":2349,"children":2350},{"class":646,"line":99},[2351],{"type":606,"tag":644,"props":2352,"children":2353},{"emptyLinePlaceholder":13},[2354],{"type":612,"value":677},{"type":606,"tag":644,"props":2356,"children":2357},{"class":646,"line":108},[2358],{"type":606,"tag":644,"props":2359,"children":2360},{"style":683},[2361],{"type":612,"value":2362},"# Calculate project duration\n",{"type":606,"tag":644,"props":2364,"children":2365},{"class":646,"line":117},[2366,2371,2375,2379,2383,2387,2391,2395,2399],{"type":606,"tag":644,"props":2367,"children":2368},{"style":656},[2369],{"type":612,"value":2370},"project_start ",{"type":606,"tag":644,"props":2372,"children":2373},{"style":650},[2374],{"type":612,"value":699},{"type":606,"tag":644,"props":2376,"children":2377},{"style":656},[2378],{"type":612,"value":704},{"type":606,"tag":644,"props":2380,"children":2381},{"style":707},[2382],{"type":612,"value":710},{"type":606,"tag":644,"props":2384,"children":2385},{"style":656},[2386],{"type":612,"value":715},{"type":606,"tag":644,"props":2388,"children":2389},{"style":707},[2390],{"type":612,"value":720},{"type":606,"tag":644,"props":2392,"children":2393},{"style":656},[2394],{"type":612,"value":715},{"type":606,"tag":644,"props":2396,"children":2397},{"style":707},[2398],{"type":612,"value":771},{"type":606,"tag":644,"props":2400,"children":2401},{"style":656},[2402],{"type":612,"value":733},{"type":606,"tag":644,"props":2404,"children":2405},{"class":646,"line":126},[2406,2411,2415,2419,2423,2427,2432,2436,2440],{"type":606,"tag":644,"props":2407,"children":2408},{"style":656},[2409],{"type":612,"value":2410},"project_end ",{"type":606,"tag":644,"props":2412,"children":2413},{"style":650},[2414],{"type":612,"value":699},{"type":606,"tag":644,"props":2416,"children":2417},{"style":656},[2418],{"type":612,"value":704},{"type":606,"tag":644,"props":2420,"children":2421},{"style":707},[2422],{"type":612,"value":710},{"type":606,"tag":644,"props":2424,"children":2425},{"style":656},[2426],{"type":612,"value":715},{"type":606,"tag":644,"props":2428,"children":2429},{"style":707},[2430],{"type":612,"value":2431},"6",{"type":606,"tag":644,"props":2433,"children":2434},{"style":656},[2435],{"type":612,"value":715},{"type":606,"tag":644,"props":2437,"children":2438},{"style":707},[2439],{"type":612,"value":1308},{"type":606,"tag":644,"props":2441,"children":2442},{"style":656},[2443],{"type":612,"value":733},{"type":606,"tag":644,"props":2445,"children":2446},{"class":646,"line":135},[2447],{"type":606,"tag":644,"props":2448,"children":2449},{"emptyLinePlaceholder":13},[2450],{"type":612,"value":677},{"type":606,"tag":644,"props":2452,"children":2453},{"class":646,"line":144},[2454,2459,2463,2468,2472],{"type":606,"tag":644,"props":2455,"children":2456},{"style":656},[2457],{"type":612,"value":2458},"duration ",{"type":606,"tag":644,"props":2460,"children":2461},{"style":650},[2462],{"type":612,"value":699},{"type":606,"tag":644,"props":2464,"children":2465},{"style":656},[2466],{"type":612,"value":2467}," project_end ",{"type":606,"tag":644,"props":2469,"children":2470},{"style":650},[2471],{"type":612,"value":804},{"type":606,"tag":644,"props":2473,"children":2474},{"style":656},[2475],{"type":612,"value":2476}," project_start\n",{"type":606,"tag":644,"props":2478,"children":2479},{"class":646,"line":153},[2480,2484,2488,2492,2497,2501,2506,2510,2515],{"type":606,"tag":644,"props":2481,"children":2482},{"style":707},[2483],{"type":612,"value":817},{"type":606,"tag":644,"props":2485,"children":2486},{"style":656},[2487],{"type":612,"value":822},{"type":606,"tag":644,"props":2489,"children":2490},{"style":650},[2491],{"type":612,"value":827},{"type":606,"tag":644,"props":2493,"children":2494},{"style":830},[2495],{"type":612,"value":2496},"\"Project duration: ",{"type":606,"tag":644,"props":2498,"children":2499},{"style":707},[2500],{"type":612,"value":838},{"type":606,"tag":644,"props":2502,"children":2503},{"style":656},[2504],{"type":612,"value":2505},"duration.days",{"type":606,"tag":644,"props":2507,"children":2508},{"style":707},[2509],{"type":612,"value":848},{"type":606,"tag":644,"props":2511,"children":2512},{"style":830},[2513],{"type":612,"value":2514}," days\"",{"type":606,"tag":644,"props":2516,"children":2517},{"style":656},[2518],{"type":612,"value":733},{"type":606,"tag":644,"props":2520,"children":2521},{"class":646,"line":163},[2522,2526,2530,2534,2538,2542,2547,2551,2556,2561,2565,2570],{"type":606,"tag":644,"props":2523,"children":2524},{"style":707},[2525],{"type":612,"value":817},{"type":606,"tag":644,"props":2527,"children":2528},{"style":656},[2529],{"type":612,"value":822},{"type":606,"tag":644,"props":2531,"children":2532},{"style":650},[2533],{"type":612,"value":827},{"type":606,"tag":644,"props":2535,"children":2536},{"style":830},[2537],{"type":612,"value":2496},{"type":606,"tag":644,"props":2539,"children":2540},{"style":707},[2541],{"type":612,"value":838},{"type":606,"tag":644,"props":2543,"children":2544},{"style":656},[2545],{"type":612,"value":2546},"duration.days ",{"type":606,"tag":644,"props":2548,"children":2549},{"style":650},[2550],{"type":612,"value":1059},{"type":606,"tag":644,"props":2552,"children":2553},{"style":707},[2554],{"type":612,"value":2555}," 7",{"type":606,"tag":644,"props":2557,"children":2558},{"style":650},[2559],{"type":612,"value":2560},":.1f",{"type":606,"tag":644,"props":2562,"children":2563},{"style":707},[2564],{"type":612,"value":848},{"type":606,"tag":644,"props":2566,"children":2567},{"style":830},[2568],{"type":612,"value":2569}," weeks\"",{"type":606,"tag":644,"props":2571,"children":2572},{"style":656},[2573],{"type":612,"value":733},{"type":606,"tag":942,"props":2575,"children":2577},{"id":2576},"time-difference-utilities",[2578],{"type":612,"value":2579},"📊 Time Difference Utilities",{"type":606,"tag":615,"props":2581,"children":2582},{},[2583],{"type":612,"value":2584},"Useful functions for working with time differences.",{"type":606,"tag":1119,"props":2586,"children":2588},{"id":2587},"duration-formatting",[2589],{"type":612,"value":2590},"Duration Formatting",{"type":606,"tag":630,"props":2592,"children":2593},{},[2594],{"type":606,"tag":634,"props":2595,"children":2597},{"className":636,"code":2596,"language":638,"meta":8,"style":8},"from datetime import timedelta\n\ndef format_duration(td):\n    \"\"\"Format timedelta in a human-readable way\"\"\"\n    total_seconds = int(td.total_seconds())\n    days = td.days\n    hours = total_seconds // 3600 % 24\n    minutes = total_seconds // 60 % 60\n    seconds = total_seconds % 60\n    \n    parts = []\n    if days:\n        parts.append(f\"{days} day{'s' if days != 1 else ''}\")\n    if hours:\n        parts.append(f\"{hours} hour{'s' if hours != 1 else ''}\")\n    if minutes:\n        parts.append(f\"{minutes} minute{'s' if minutes != 1 else ''}\")\n    if seconds and not (days or hours):\n        parts.append(f\"{seconds} second{'s' if seconds != 1 else ''}\")\n    \n    return ', '.join(parts) if parts else '0 seconds'\n\n# Example usage\ndurations = [\n    timedelta(days=5, hours=3, minutes=30),\n    timedelta(hours=2, minutes=45),\n    timedelta(minutes=30),\n    timedelta(seconds=45)\n]\n\nfor duration in durations:\n    print(f\"{duration} → {format_duration(duration)}\")\n",[2598],{"type":606,"tag":621,"props":2599,"children":2600},{"__ignoreMap":8},[2601,2620,2627,2646,2654,2676,2693,2729,2763,2788,2796,2813,2826,2910,2922,2999,3011,3088,3125,3201,3208,3246,3253,3261,3278,3335,3374,3397,3420,3428,3435,3458],{"type":606,"tag":644,"props":2602,"children":2603},{"class":646,"line":12},[2604,2608,2612,2616],{"type":606,"tag":644,"props":2605,"children":2606},{"style":650},[2607],{"type":612,"value":653},{"type":606,"tag":644,"props":2609,"children":2610},{"style":656},[2611],{"type":612,"value":659},{"type":606,"tag":644,"props":2613,"children":2614},{"style":650},[2615],{"type":612,"value":664},{"type":606,"tag":644,"props":2617,"children":2618},{"style":656},[2619],{"type":612,"value":1585},{"type":606,"tag":644,"props":2621,"children":2622},{"class":646,"line":27},[2623],{"type":606,"tag":644,"props":2624,"children":2625},{"emptyLinePlaceholder":13},[2626],{"type":612,"value":677},{"type":606,"tag":644,"props":2628,"children":2629},{"class":646,"line":36},[2630,2635,2641],{"type":606,"tag":644,"props":2631,"children":2632},{"style":650},[2633],{"type":612,"value":2634},"def",{"type":606,"tag":644,"props":2636,"children":2638},{"style":2637},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2639],{"type":612,"value":2640}," format_duration",{"type":606,"tag":644,"props":2642,"children":2643},{"style":656},[2644],{"type":612,"value":2645},"(td):\n",{"type":606,"tag":644,"props":2647,"children":2648},{"class":646,"line":45},[2649],{"type":606,"tag":644,"props":2650,"children":2651},{"style":830},[2652],{"type":612,"value":2653},"    \"\"\"Format timedelta in a human-readable way\"\"\"\n",{"type":606,"tag":644,"props":2655,"children":2656},{"class":646,"line":54},[2657,2662,2666,2671],{"type":606,"tag":644,"props":2658,"children":2659},{"style":656},[2660],{"type":612,"value":2661},"    total_seconds ",{"type":606,"tag":644,"props":2663,"children":2664},{"style":650},[2665],{"type":612,"value":699},{"type":606,"tag":644,"props":2667,"children":2668},{"style":707},[2669],{"type":612,"value":2670}," int",{"type":606,"tag":644,"props":2672,"children":2673},{"style":656},[2674],{"type":612,"value":2675},"(td.total_seconds())\n",{"type":606,"tag":644,"props":2677,"children":2678},{"class":646,"line":63},[2679,2684,2688],{"type":606,"tag":644,"props":2680,"children":2681},{"style":656},[2682],{"type":612,"value":2683},"    days ",{"type":606,"tag":644,"props":2685,"children":2686},{"style":650},[2687],{"type":612,"value":699},{"type":606,"tag":644,"props":2689,"children":2690},{"style":656},[2691],{"type":612,"value":2692}," td.days\n",{"type":606,"tag":644,"props":2694,"children":2695},{"class":646,"line":72},[2696,2701,2705,2710,2714,2719,2724],{"type":606,"tag":644,"props":2697,"children":2698},{"style":656},[2699],{"type":612,"value":2700},"    hours ",{"type":606,"tag":644,"props":2702,"children":2703},{"style":650},[2704],{"type":612,"value":699},{"type":606,"tag":644,"props":2706,"children":2707},{"style":656},[2708],{"type":612,"value":2709}," total_seconds ",{"type":606,"tag":644,"props":2711,"children":2712},{"style":650},[2713],{"type":612,"value":2334},{"type":606,"tag":644,"props":2715,"children":2716},{"style":707},[2717],{"type":612,"value":2718}," 3600",{"type":606,"tag":644,"props":2720,"children":2721},{"style":650},[2722],{"type":612,"value":2723}," %",{"type":606,"tag":644,"props":2725,"children":2726},{"style":707},[2727],{"type":612,"value":2728}," 24\n",{"type":606,"tag":644,"props":2730,"children":2731},{"class":646,"line":81},[2732,2737,2741,2745,2749,2754,2758],{"type":606,"tag":644,"props":2733,"children":2734},{"style":656},[2735],{"type":612,"value":2736},"    minutes ",{"type":606,"tag":644,"props":2738,"children":2739},{"style":650},[2740],{"type":612,"value":699},{"type":606,"tag":644,"props":2742,"children":2743},{"style":656},[2744],{"type":612,"value":2709},{"type":606,"tag":644,"props":2746,"children":2747},{"style":650},[2748],{"type":612,"value":2334},{"type":606,"tag":644,"props":2750,"children":2751},{"style":707},[2752],{"type":612,"value":2753}," 60",{"type":606,"tag":644,"props":2755,"children":2756},{"style":650},[2757],{"type":612,"value":2723},{"type":606,"tag":644,"props":2759,"children":2760},{"style":707},[2761],{"type":612,"value":2762}," 60\n",{"type":606,"tag":644,"props":2764,"children":2765},{"class":646,"line":860},[2766,2771,2775,2779,2784],{"type":606,"tag":644,"props":2767,"children":2768},{"style":656},[2769],{"type":612,"value":2770},"    seconds ",{"type":606,"tag":644,"props":2772,"children":2773},{"style":650},[2774],{"type":612,"value":699},{"type":606,"tag":644,"props":2776,"children":2777},{"style":656},[2778],{"type":612,"value":2709},{"type":606,"tag":644,"props":2780,"children":2781},{"style":650},[2782],{"type":612,"value":2783},"%",{"type":606,"tag":644,"props":2785,"children":2786},{"style":707},[2787],{"type":612,"value":2762},{"type":606,"tag":644,"props":2789,"children":2790},{"class":646,"line":99},[2791],{"type":606,"tag":644,"props":2792,"children":2793},{"style":656},[2794],{"type":612,"value":2795},"    \n",{"type":606,"tag":644,"props":2797,"children":2798},{"class":646,"line":108},[2799,2804,2808],{"type":606,"tag":644,"props":2800,"children":2801},{"style":656},[2802],{"type":612,"value":2803},"    parts ",{"type":606,"tag":644,"props":2805,"children":2806},{"style":650},[2807],{"type":612,"value":699},{"type":606,"tag":644,"props":2809,"children":2810},{"style":656},[2811],{"type":612,"value":2812}," []\n",{"type":606,"tag":644,"props":2814,"children":2815},{"class":646,"line":117},[2816,2821],{"type":606,"tag":644,"props":2817,"children":2818},{"style":650},[2819],{"type":612,"value":2820},"    if",{"type":606,"tag":644,"props":2822,"children":2823},{"style":656},[2824],{"type":612,"value":2825}," days:\n",{"type":606,"tag":644,"props":2827,"children":2828},{"class":646,"line":126},[2829,2834,2838,2842,2846,2850,2854,2859,2863,2868,2873,2878,2883,2888,2893,2898,2902,2906],{"type":606,"tag":644,"props":2830,"children":2831},{"style":656},[2832],{"type":612,"value":2833},"        parts.append(",{"type":606,"tag":644,"props":2835,"children":2836},{"style":650},[2837],{"type":612,"value":827},{"type":606,"tag":644,"props":2839,"children":2840},{"style":830},[2841],{"type":612,"value":853},{"type":606,"tag":644,"props":2843,"children":2844},{"style":707},[2845],{"type":612,"value":838},{"type":606,"tag":644,"props":2847,"children":2848},{"style":656},[2849],{"type":612,"value":982},{"type":606,"tag":644,"props":2851,"children":2852},{"style":707},[2853],{"type":612,"value":848},{"type":606,"tag":644,"props":2855,"children":2856},{"style":830},[2857],{"type":612,"value":2858}," day",{"type":606,"tag":644,"props":2860,"children":2861},{"style":707},[2862],{"type":612,"value":838},{"type":606,"tag":644,"props":2864,"children":2865},{"style":830},[2866],{"type":612,"value":2867},"'s'",{"type":606,"tag":644,"props":2869,"children":2870},{"style":650},[2871],{"type":612,"value":2872}," if",{"type":606,"tag":644,"props":2874,"children":2875},{"style":656},[2876],{"type":612,"value":2877}," days ",{"type":606,"tag":644,"props":2879,"children":2880},{"style":650},[2881],{"type":612,"value":2882},"!=",{"type":606,"tag":644,"props":2884,"children":2885},{"style":707},[2886],{"type":612,"value":2887}," 1",{"type":606,"tag":644,"props":2889,"children":2890},{"style":650},[2891],{"type":612,"value":2892}," else",{"type":606,"tag":644,"props":2894,"children":2895},{"style":830},[2896],{"type":612,"value":2897}," ''",{"type":606,"tag":644,"props":2899,"children":2900},{"style":707},[2901],{"type":612,"value":848},{"type":606,"tag":644,"props":2903,"children":2904},{"style":830},[2905],{"type":612,"value":853},{"type":606,"tag":644,"props":2907,"children":2908},{"style":656},[2909],{"type":612,"value":733},{"type":606,"tag":644,"props":2911,"children":2912},{"class":646,"line":135},[2913,2917],{"type":606,"tag":644,"props":2914,"children":2915},{"style":650},[2916],{"type":612,"value":2820},{"type":606,"tag":644,"props":2918,"children":2919},{"style":656},[2920],{"type":612,"value":2921}," hours:\n",{"type":606,"tag":644,"props":2923,"children":2924},{"class":646,"line":144},[2925,2929,2933,2937,2941,2945,2949,2954,2958,2962,2966,2971,2975,2979,2983,2987,2991,2995],{"type":606,"tag":644,"props":2926,"children":2927},{"style":656},[2928],{"type":612,"value":2833},{"type":606,"tag":644,"props":2930,"children":2931},{"style":650},[2932],{"type":612,"value":827},{"type":606,"tag":644,"props":2934,"children":2935},{"style":830},[2936],{"type":612,"value":853},{"type":606,"tag":644,"props":2938,"children":2939},{"style":707},[2940],{"type":612,"value":838},{"type":606,"tag":644,"props":2942,"children":2943},{"style":656},[2944],{"type":612,"value":1282},{"type":606,"tag":644,"props":2946,"children":2947},{"style":707},[2948],{"type":612,"value":848},{"type":606,"tag":644,"props":2950,"children":2951},{"style":830},[2952],{"type":612,"value":2953}," hour",{"type":606,"tag":644,"props":2955,"children":2956},{"style":707},[2957],{"type":612,"value":838},{"type":606,"tag":644,"props":2959,"children":2960},{"style":830},[2961],{"type":612,"value":2867},{"type":606,"tag":644,"props":2963,"children":2964},{"style":650},[2965],{"type":612,"value":2872},{"type":606,"tag":644,"props":2967,"children":2968},{"style":656},[2969],{"type":612,"value":2970}," hours ",{"type":606,"tag":644,"props":2972,"children":2973},{"style":650},[2974],{"type":612,"value":2882},{"type":606,"tag":644,"props":2976,"children":2977},{"style":707},[2978],{"type":612,"value":2887},{"type":606,"tag":644,"props":2980,"children":2981},{"style":650},[2982],{"type":612,"value":2892},{"type":606,"tag":644,"props":2984,"children":2985},{"style":830},[2986],{"type":612,"value":2897},{"type":606,"tag":644,"props":2988,"children":2989},{"style":707},[2990],{"type":612,"value":848},{"type":606,"tag":644,"props":2992,"children":2993},{"style":830},[2994],{"type":612,"value":853},{"type":606,"tag":644,"props":2996,"children":2997},{"style":656},[2998],{"type":612,"value":733},{"type":606,"tag":644,"props":3000,"children":3001},{"class":646,"line":153},[3002,3006],{"type":606,"tag":644,"props":3003,"children":3004},{"style":650},[3005],{"type":612,"value":2820},{"type":606,"tag":644,"props":3007,"children":3008},{"style":656},[3009],{"type":612,"value":3010}," minutes:\n",{"type":606,"tag":644,"props":3012,"children":3013},{"class":646,"line":163},[3014,3018,3022,3026,3030,3034,3038,3043,3047,3051,3055,3060,3064,3068,3072,3076,3080,3084],{"type":606,"tag":644,"props":3015,"children":3016},{"style":656},[3017],{"type":612,"value":2833},{"type":606,"tag":644,"props":3019,"children":3020},{"style":650},[3021],{"type":612,"value":827},{"type":606,"tag":644,"props":3023,"children":3024},{"style":830},[3025],{"type":612,"value":853},{"type":606,"tag":644,"props":3027,"children":3028},{"style":707},[3029],{"type":612,"value":838},{"type":606,"tag":644,"props":3031,"children":3032},{"style":656},[3033],{"type":612,"value":1299},{"type":606,"tag":644,"props":3035,"children":3036},{"style":707},[3037],{"type":612,"value":848},{"type":606,"tag":644,"props":3039,"children":3040},{"style":830},[3041],{"type":612,"value":3042}," minute",{"type":606,"tag":644,"props":3044,"children":3045},{"style":707},[3046],{"type":612,"value":838},{"type":606,"tag":644,"props":3048,"children":3049},{"style":830},[3050],{"type":612,"value":2867},{"type":606,"tag":644,"props":3052,"children":3053},{"style":650},[3054],{"type":612,"value":2872},{"type":606,"tag":644,"props":3056,"children":3057},{"style":656},[3058],{"type":612,"value":3059}," minutes ",{"type":606,"tag":644,"props":3061,"children":3062},{"style":650},[3063],{"type":612,"value":2882},{"type":606,"tag":644,"props":3065,"children":3066},{"style":707},[3067],{"type":612,"value":2887},{"type":606,"tag":644,"props":3069,"children":3070},{"style":650},[3071],{"type":612,"value":2892},{"type":606,"tag":644,"props":3073,"children":3074},{"style":830},[3075],{"type":612,"value":2897},{"type":606,"tag":644,"props":3077,"children":3078},{"style":707},[3079],{"type":612,"value":848},{"type":606,"tag":644,"props":3081,"children":3082},{"style":830},[3083],{"type":612,"value":853},{"type":606,"tag":644,"props":3085,"children":3086},{"style":656},[3087],{"type":612,"value":733},{"type":606,"tag":644,"props":3089,"children":3090},{"class":646,"line":172},[3091,3095,3100,3105,3110,3115,3120],{"type":606,"tag":644,"props":3092,"children":3093},{"style":650},[3094],{"type":612,"value":2820},{"type":606,"tag":644,"props":3096,"children":3097},{"style":656},[3098],{"type":612,"value":3099}," seconds ",{"type":606,"tag":644,"props":3101,"children":3102},{"style":650},[3103],{"type":612,"value":3104},"and",{"type":606,"tag":644,"props":3106,"children":3107},{"style":650},[3108],{"type":612,"value":3109}," not",{"type":606,"tag":644,"props":3111,"children":3112},{"style":656},[3113],{"type":612,"value":3114}," (days ",{"type":606,"tag":644,"props":3116,"children":3117},{"style":650},[3118],{"type":612,"value":3119},"or",{"type":606,"tag":644,"props":3121,"children":3122},{"style":656},[3123],{"type":612,"value":3124}," hours):\n",{"type":606,"tag":644,"props":3126,"children":3127},{"class":646,"line":181},[3128,3132,3136,3140,3144,3148,3152,3157,3161,3165,3169,3173,3177,3181,3185,3189,3193,3197],{"type":606,"tag":644,"props":3129,"children":3130},{"style":656},[3131],{"type":612,"value":2833},{"type":606,"tag":644,"props":3133,"children":3134},{"style":650},[3135],{"type":612,"value":827},{"type":606,"tag":644,"props":3137,"children":3138},{"style":830},[3139],{"type":612,"value":853},{"type":606,"tag":644,"props":3141,"children":3142},{"style":707},[3143],{"type":612,"value":838},{"type":606,"tag":644,"props":3145,"children":3146},{"style":656},[3147],{"type":612,"value":993},{"type":606,"tag":644,"props":3149,"children":3150},{"style":707},[3151],{"type":612,"value":848},{"type":606,"tag":644,"props":3153,"children":3154},{"style":830},[3155],{"type":612,"value":3156}," second",{"type":606,"tag":644,"props":3158,"children":3159},{"style":707},[3160],{"type":612,"value":838},{"type":606,"tag":644,"props":3162,"children":3163},{"style":830},[3164],{"type":612,"value":2867},{"type":606,"tag":644,"props":3166,"children":3167},{"style":650},[3168],{"type":612,"value":2872},{"type":606,"tag":644,"props":3170,"children":3171},{"style":656},[3172],{"type":612,"value":3099},{"type":606,"tag":644,"props":3174,"children":3175},{"style":650},[3176],{"type":612,"value":2882},{"type":606,"tag":644,"props":3178,"children":3179},{"style":707},[3180],{"type":612,"value":2887},{"type":606,"tag":644,"props":3182,"children":3183},{"style":650},[3184],{"type":612,"value":2892},{"type":606,"tag":644,"props":3186,"children":3187},{"style":830},[3188],{"type":612,"value":2897},{"type":606,"tag":644,"props":3190,"children":3191},{"style":707},[3192],{"type":612,"value":848},{"type":606,"tag":644,"props":3194,"children":3195},{"style":830},[3196],{"type":612,"value":853},{"type":606,"tag":644,"props":3198,"children":3199},{"style":656},[3200],{"type":612,"value":733},{"type":606,"tag":644,"props":3202,"children":3203},{"class":646,"line":190},[3204],{"type":606,"tag":644,"props":3205,"children":3206},{"style":656},[3207],{"type":612,"value":2795},{"type":606,"tag":644,"props":3209,"children":3210},{"class":646,"line":199},[3211,3216,3221,3226,3231,3236,3241],{"type":606,"tag":644,"props":3212,"children":3213},{"style":650},[3214],{"type":612,"value":3215},"    return",{"type":606,"tag":644,"props":3217,"children":3218},{"style":830},[3219],{"type":612,"value":3220}," ', '",{"type":606,"tag":644,"props":3222,"children":3223},{"style":656},[3224],{"type":612,"value":3225},".join(parts) ",{"type":606,"tag":644,"props":3227,"children":3228},{"style":650},[3229],{"type":612,"value":3230},"if",{"type":606,"tag":644,"props":3232,"children":3233},{"style":656},[3234],{"type":612,"value":3235}," parts ",{"type":606,"tag":644,"props":3237,"children":3238},{"style":650},[3239],{"type":612,"value":3240},"else",{"type":606,"tag":644,"props":3242,"children":3243},{"style":830},[3244],{"type":612,"value":3245}," '0 seconds'\n",{"type":606,"tag":644,"props":3247,"children":3248},{"class":646,"line":208},[3249],{"type":606,"tag":644,"props":3250,"children":3251},{"emptyLinePlaceholder":13},[3252],{"type":612,"value":677},{"type":606,"tag":644,"props":3254,"children":3255},{"class":646,"line":217},[3256],{"type":606,"tag":644,"props":3257,"children":3258},{"style":683},[3259],{"type":612,"value":3260},"# Example usage\n",{"type":606,"tag":644,"props":3262,"children":3263},{"class":646,"line":227},[3264,3269,3273],{"type":606,"tag":644,"props":3265,"children":3266},{"style":656},[3267],{"type":612,"value":3268},"durations ",{"type":606,"tag":644,"props":3270,"children":3271},{"style":650},[3272],{"type":612,"value":699},{"type":606,"tag":644,"props":3274,"children":3275},{"style":656},[3276],{"type":612,"value":3277}," [\n",{"type":606,"tag":644,"props":3279,"children":3280},{"class":646,"line":236},[3281,3286,3290,3294,3298,3302,3306,3310,3314,3318,3322,3326,3330],{"type":606,"tag":644,"props":3282,"children":3283},{"style":656},[3284],{"type":612,"value":3285},"    timedelta(",{"type":606,"tag":644,"props":3287,"children":3288},{"style":1262},[3289],{"type":612,"value":982},{"type":606,"tag":644,"props":3291,"children":3292},{"style":650},[3293],{"type":612,"value":699},{"type":606,"tag":644,"props":3295,"children":3296},{"style":707},[3297],{"type":612,"value":1757},{"type":606,"tag":644,"props":3299,"children":3300},{"style":656},[3301],{"type":612,"value":715},{"type":606,"tag":644,"props":3303,"children":3304},{"style":1262},[3305],{"type":612,"value":1282},{"type":606,"tag":644,"props":3307,"children":3308},{"style":650},[3309],{"type":612,"value":699},{"type":606,"tag":644,"props":3311,"children":3312},{"style":707},[3313],{"type":612,"value":762},{"type":606,"tag":644,"props":3315,"children":3316},{"style":656},[3317],{"type":612,"value":715},{"type":606,"tag":644,"props":3319,"children":3320},{"style":1262},[3321],{"type":612,"value":1299},{"type":606,"tag":644,"props":3323,"children":3324},{"style":650},[3325],{"type":612,"value":699},{"type":606,"tag":644,"props":3327,"children":3328},{"style":707},[3329],{"type":612,"value":1308},{"type":606,"tag":644,"props":3331,"children":3332},{"style":656},[3333],{"type":612,"value":3334},"),\n",{"type":606,"tag":644,"props":3336,"children":3337},{"class":646,"line":245},[3338,3342,3346,3350,3354,3358,3362,3366,3370],{"type":606,"tag":644,"props":3339,"children":3340},{"style":656},[3341],{"type":612,"value":3285},{"type":606,"tag":644,"props":3343,"children":3344},{"style":1262},[3345],{"type":612,"value":1282},{"type":606,"tag":644,"props":3347,"children":3348},{"style":650},[3349],{"type":612,"value":699},{"type":606,"tag":644,"props":3351,"children":3352},{"style":707},[3353],{"type":612,"value":1406},{"type":606,"tag":644,"props":3355,"children":3356},{"style":656},[3357],{"type":612,"value":715},{"type":606,"tag":644,"props":3359,"children":3360},{"style":1262},[3361],{"type":612,"value":1299},{"type":606,"tag":644,"props":3363,"children":3364},{"style":650},[3365],{"type":612,"value":699},{"type":606,"tag":644,"props":3367,"children":3368},{"style":707},[3369],{"type":612,"value":1807},{"type":606,"tag":644,"props":3371,"children":3372},{"style":656},[3373],{"type":612,"value":3334},{"type":606,"tag":644,"props":3375,"children":3376},{"class":646,"line":254},[3377,3381,3385,3389,3393],{"type":606,"tag":644,"props":3378,"children":3379},{"style":656},[3380],{"type":612,"value":3285},{"type":606,"tag":644,"props":3382,"children":3383},{"style":1262},[3384],{"type":612,"value":1299},{"type":606,"tag":644,"props":3386,"children":3387},{"style":650},[3388],{"type":612,"value":699},{"type":606,"tag":644,"props":3390,"children":3391},{"style":707},[3392],{"type":612,"value":1308},{"type":606,"tag":644,"props":3394,"children":3395},{"style":656},[3396],{"type":612,"value":3334},{"type":606,"tag":644,"props":3398,"children":3399},{"class":646,"line":263},[3400,3404,3408,3412,3416],{"type":606,"tag":644,"props":3401,"children":3402},{"style":656},[3403],{"type":612,"value":3285},{"type":606,"tag":644,"props":3405,"children":3406},{"style":1262},[3407],{"type":612,"value":993},{"type":606,"tag":644,"props":3409,"children":3410},{"style":650},[3411],{"type":612,"value":699},{"type":606,"tag":644,"props":3413,"children":3414},{"style":707},[3415],{"type":612,"value":1807},{"type":606,"tag":644,"props":3417,"children":3418},{"style":656},[3419],{"type":612,"value":733},{"type":606,"tag":644,"props":3421,"children":3422},{"class":646,"line":272},[3423],{"type":606,"tag":644,"props":3424,"children":3425},{"style":656},[3426],{"type":612,"value":3427},"]\n",{"type":606,"tag":644,"props":3429,"children":3430},{"class":646,"line":281},[3431],{"type":606,"tag":644,"props":3432,"children":3433},{"emptyLinePlaceholder":13},[3434],{"type":612,"value":677},{"type":606,"tag":644,"props":3436,"children":3437},{"class":646,"line":291},[3438,3443,3448,3453],{"type":606,"tag":644,"props":3439,"children":3440},{"style":650},[3441],{"type":612,"value":3442},"for",{"type":606,"tag":644,"props":3444,"children":3445},{"style":656},[3446],{"type":612,"value":3447}," duration ",{"type":606,"tag":644,"props":3449,"children":3450},{"style":650},[3451],{"type":612,"value":3452},"in",{"type":606,"tag":644,"props":3454,"children":3455},{"style":656},[3456],{"type":612,"value":3457}," durations:\n",{"type":606,"tag":644,"props":3459,"children":3460},{"class":646,"line":302},[3461,3466,3470,3474,3478,3482,3487,3491,3496,3500,3505,3509,3513],{"type":606,"tag":644,"props":3462,"children":3463},{"style":707},[3464],{"type":612,"value":3465},"    print",{"type":606,"tag":644,"props":3467,"children":3468},{"style":656},[3469],{"type":612,"value":822},{"type":606,"tag":644,"props":3471,"children":3472},{"style":650},[3473],{"type":612,"value":827},{"type":606,"tag":644,"props":3475,"children":3476},{"style":830},[3477],{"type":612,"value":853},{"type":606,"tag":644,"props":3479,"children":3480},{"style":707},[3481],{"type":612,"value":838},{"type":606,"tag":644,"props":3483,"children":3484},{"style":656},[3485],{"type":612,"value":3486},"duration",{"type":606,"tag":644,"props":3488,"children":3489},{"style":707},[3490],{"type":612,"value":848},{"type":606,"tag":644,"props":3492,"children":3493},{"style":830},[3494],{"type":612,"value":3495}," → ",{"type":606,"tag":644,"props":3497,"children":3498},{"style":707},[3499],{"type":612,"value":838},{"type":606,"tag":644,"props":3501,"children":3502},{"style":656},[3503],{"type":612,"value":3504},"format_duration(duration)",{"type":606,"tag":644,"props":3506,"children":3507},{"style":707},[3508],{"type":612,"value":848},{"type":606,"tag":644,"props":3510,"children":3511},{"style":830},[3512],{"type":612,"value":853},{"type":606,"tag":644,"props":3514,"children":3515},{"style":656},[3516],{"type":612,"value":733},{"type":606,"tag":1119,"props":3518,"children":3520},{"id":3519},"business-days-calculation",[3521],{"type":612,"value":3522},"Business Days Calculation",{"type":606,"tag":630,"props":3524,"children":3525},{},[3526],{"type":606,"tag":634,"props":3527,"children":3529},{"className":636,"code":3528,"language":638,"meta":8,"style":8},"from datetime import datetime, timedelta\n\ndef count_business_days(start_date, end_date):\n    \"\"\"Count business days between two dates (excluding weekends)\"\"\"\n    business_days = 0\n    current_date = start_date\n    \n    while current_date \u003C end_date:\n        # Monday = 0, Sunday = 6\n        if current_date.weekday() \u003C 5:  # Monday to Friday\n            business_days += 1\n        current_date += timedelta(days=1)\n    \n    return business_days\n\ndef add_business_days(start_date, business_days):\n    \"\"\"Add business days to a date (excluding weekends)\"\"\"\n    current_date = start_date\n    days_added = 0\n    \n    while days_added \u003C business_days:\n        current_date += timedelta(days=1)\n        if current_date.weekday() \u003C 5:  # Monday to Friday\n            days_added += 1\n    \n    return current_date\n\n# Example usage\nstart = datetime(2024, 3, 15)  # Assuming it's a weekday\nend = datetime(2024, 3, 25)\n\nbiz_days = count_business_days(start, end)\nprint(f\"Business days between {start.date()} and {end.date()}: {biz_days}\")\n\nfuture_biz_date = add_business_days(start, 10)\nprint(f\"10 business days after {start.date()}: {future_biz_date.date()}\")\n",[3530],{"type":606,"tag":621,"props":3531,"children":3532},{"__ignoreMap":8},[3533,3552,3559,3576,3584,3601,3617,3624,3646,3654,3686,3704,3736,3743,3755,3762,3779,3787,3802,3818,3825,3846,3877,3904,3920,3927,3939,3946,3953,3999,4040,4047,4064,4141,4148,4174],{"type":606,"tag":644,"props":3534,"children":3535},{"class":646,"line":12},[3536,3540,3544,3548],{"type":606,"tag":644,"props":3537,"children":3538},{"style":650},[3539],{"type":612,"value":653},{"type":606,"tag":644,"props":3541,"children":3542},{"style":656},[3543],{"type":612,"value":659},{"type":606,"tag":644,"props":3545,"children":3546},{"style":650},[3547],{"type":612,"value":664},{"type":606,"tag":644,"props":3549,"children":3550},{"style":656},[3551],{"type":612,"value":669},{"type":606,"tag":644,"props":3553,"children":3554},{"class":646,"line":27},[3555],{"type":606,"tag":644,"props":3556,"children":3557},{"emptyLinePlaceholder":13},[3558],{"type":612,"value":677},{"type":606,"tag":644,"props":3560,"children":3561},{"class":646,"line":36},[3562,3566,3571],{"type":606,"tag":644,"props":3563,"children":3564},{"style":650},[3565],{"type":612,"value":2634},{"type":606,"tag":644,"props":3567,"children":3568},{"style":2637},[3569],{"type":612,"value":3570}," count_business_days",{"type":606,"tag":644,"props":3572,"children":3573},{"style":656},[3574],{"type":612,"value":3575},"(start_date, end_date):\n",{"type":606,"tag":644,"props":3577,"children":3578},{"class":646,"line":45},[3579],{"type":606,"tag":644,"props":3580,"children":3581},{"style":830},[3582],{"type":612,"value":3583},"    \"\"\"Count business days between two dates (excluding weekends)\"\"\"\n",{"type":606,"tag":644,"props":3585,"children":3586},{"class":646,"line":54},[3587,3592,3596],{"type":606,"tag":644,"props":3588,"children":3589},{"style":656},[3590],{"type":612,"value":3591},"    business_days ",{"type":606,"tag":644,"props":3593,"children":3594},{"style":650},[3595],{"type":612,"value":699},{"type":606,"tag":644,"props":3597,"children":3598},{"style":707},[3599],{"type":612,"value":3600}," 0\n",{"type":606,"tag":644,"props":3602,"children":3603},{"class":646,"line":63},[3604,3609,3613],{"type":606,"tag":644,"props":3605,"children":3606},{"style":656},[3607],{"type":612,"value":3608},"    current_date ",{"type":606,"tag":644,"props":3610,"children":3611},{"style":650},[3612],{"type":612,"value":699},{"type":606,"tag":644,"props":3614,"children":3615},{"style":656},[3616],{"type":612,"value":809},{"type":606,"tag":644,"props":3618,"children":3619},{"class":646,"line":72},[3620],{"type":606,"tag":644,"props":3621,"children":3622},{"style":656},[3623],{"type":612,"value":2795},{"type":606,"tag":644,"props":3625,"children":3626},{"class":646,"line":81},[3627,3632,3637,3641],{"type":606,"tag":644,"props":3628,"children":3629},{"style":650},[3630],{"type":612,"value":3631},"    while",{"type":606,"tag":644,"props":3633,"children":3634},{"style":656},[3635],{"type":612,"value":3636}," current_date ",{"type":606,"tag":644,"props":3638,"children":3639},{"style":650},[3640],{"type":612,"value":1077},{"type":606,"tag":644,"props":3642,"children":3643},{"style":656},[3644],{"type":612,"value":3645}," end_date:\n",{"type":606,"tag":644,"props":3647,"children":3648},{"class":646,"line":860},[3649],{"type":606,"tag":644,"props":3650,"children":3651},{"style":683},[3652],{"type":612,"value":3653},"        # Monday = 0, Sunday = 6\n",{"type":606,"tag":644,"props":3655,"children":3656},{"class":646,"line":99},[3657,3662,3667,3671,3676,3681],{"type":606,"tag":644,"props":3658,"children":3659},{"style":650},[3660],{"type":612,"value":3661},"        if",{"type":606,"tag":644,"props":3663,"children":3664},{"style":656},[3665],{"type":612,"value":3666}," current_date.weekday() ",{"type":606,"tag":644,"props":3668,"children":3669},{"style":650},[3670],{"type":612,"value":1077},{"type":606,"tag":644,"props":3672,"children":3673},{"style":707},[3674],{"type":612,"value":3675}," 5",{"type":606,"tag":644,"props":3677,"children":3678},{"style":656},[3679],{"type":612,"value":3680},":  ",{"type":606,"tag":644,"props":3682,"children":3683},{"style":683},[3684],{"type":612,"value":3685},"# Monday to Friday\n",{"type":606,"tag":644,"props":3687,"children":3688},{"class":646,"line":108},[3689,3694,3699],{"type":606,"tag":644,"props":3690,"children":3691},{"style":656},[3692],{"type":612,"value":3693},"            business_days ",{"type":606,"tag":644,"props":3695,"children":3696},{"style":650},[3697],{"type":612,"value":3698},"+=",{"type":606,"tag":644,"props":3700,"children":3701},{"style":707},[3702],{"type":612,"value":3703}," 1\n",{"type":606,"tag":644,"props":3705,"children":3706},{"class":646,"line":117},[3707,3712,3716,3720,3724,3728,3732],{"type":606,"tag":644,"props":3708,"children":3709},{"style":656},[3710],{"type":612,"value":3711},"        current_date ",{"type":606,"tag":644,"props":3713,"children":3714},{"style":650},[3715],{"type":612,"value":3698},{"type":606,"tag":644,"props":3717,"children":3718},{"style":656},[3719],{"type":612,"value":1259},{"type":606,"tag":644,"props":3721,"children":3722},{"style":1262},[3723],{"type":612,"value":982},{"type":606,"tag":644,"props":3725,"children":3726},{"style":650},[3727],{"type":612,"value":699},{"type":606,"tag":644,"props":3729,"children":3730},{"style":707},[3731],{"type":612,"value":720},{"type":606,"tag":644,"props":3733,"children":3734},{"style":656},[3735],{"type":612,"value":733},{"type":606,"tag":644,"props":3737,"children":3738},{"class":646,"line":126},[3739],{"type":606,"tag":644,"props":3740,"children":3741},{"style":656},[3742],{"type":612,"value":2795},{"type":606,"tag":644,"props":3744,"children":3745},{"class":646,"line":135},[3746,3750],{"type":606,"tag":644,"props":3747,"children":3748},{"style":650},[3749],{"type":612,"value":3215},{"type":606,"tag":644,"props":3751,"children":3752},{"style":656},[3753],{"type":612,"value":3754}," business_days\n",{"type":606,"tag":644,"props":3756,"children":3757},{"class":646,"line":144},[3758],{"type":606,"tag":644,"props":3759,"children":3760},{"emptyLinePlaceholder":13},[3761],{"type":612,"value":677},{"type":606,"tag":644,"props":3763,"children":3764},{"class":646,"line":153},[3765,3769,3774],{"type":606,"tag":644,"props":3766,"children":3767},{"style":650},[3768],{"type":612,"value":2634},{"type":606,"tag":644,"props":3770,"children":3771},{"style":2637},[3772],{"type":612,"value":3773}," add_business_days",{"type":606,"tag":644,"props":3775,"children":3776},{"style":656},[3777],{"type":612,"value":3778},"(start_date, business_days):\n",{"type":606,"tag":644,"props":3780,"children":3781},{"class":646,"line":163},[3782],{"type":606,"tag":644,"props":3783,"children":3784},{"style":830},[3785],{"type":612,"value":3786},"    \"\"\"Add business days to a date (excluding weekends)\"\"\"\n",{"type":606,"tag":644,"props":3788,"children":3789},{"class":646,"line":172},[3790,3794,3798],{"type":606,"tag":644,"props":3791,"children":3792},{"style":656},[3793],{"type":612,"value":3608},{"type":606,"tag":644,"props":3795,"children":3796},{"style":650},[3797],{"type":612,"value":699},{"type":606,"tag":644,"props":3799,"children":3800},{"style":656},[3801],{"type":612,"value":809},{"type":606,"tag":644,"props":3803,"children":3804},{"class":646,"line":181},[3805,3810,3814],{"type":606,"tag":644,"props":3806,"children":3807},{"style":656},[3808],{"type":612,"value":3809},"    days_added ",{"type":606,"tag":644,"props":3811,"children":3812},{"style":650},[3813],{"type":612,"value":699},{"type":606,"tag":644,"props":3815,"children":3816},{"style":707},[3817],{"type":612,"value":3600},{"type":606,"tag":644,"props":3819,"children":3820},{"class":646,"line":190},[3821],{"type":606,"tag":644,"props":3822,"children":3823},{"style":656},[3824],{"type":612,"value":2795},{"type":606,"tag":644,"props":3826,"children":3827},{"class":646,"line":199},[3828,3832,3837,3841],{"type":606,"tag":644,"props":3829,"children":3830},{"style":650},[3831],{"type":612,"value":3631},{"type":606,"tag":644,"props":3833,"children":3834},{"style":656},[3835],{"type":612,"value":3836}," days_added ",{"type":606,"tag":644,"props":3838,"children":3839},{"style":650},[3840],{"type":612,"value":1077},{"type":606,"tag":644,"props":3842,"children":3843},{"style":656},[3844],{"type":612,"value":3845}," business_days:\n",{"type":606,"tag":644,"props":3847,"children":3848},{"class":646,"line":208},[3849,3853,3857,3861,3865,3869,3873],{"type":606,"tag":644,"props":3850,"children":3851},{"style":656},[3852],{"type":612,"value":3711},{"type":606,"tag":644,"props":3854,"children":3855},{"style":650},[3856],{"type":612,"value":3698},{"type":606,"tag":644,"props":3858,"children":3859},{"style":656},[3860],{"type":612,"value":1259},{"type":606,"tag":644,"props":3862,"children":3863},{"style":1262},[3864],{"type":612,"value":982},{"type":606,"tag":644,"props":3866,"children":3867},{"style":650},[3868],{"type":612,"value":699},{"type":606,"tag":644,"props":3870,"children":3871},{"style":707},[3872],{"type":612,"value":720},{"type":606,"tag":644,"props":3874,"children":3875},{"style":656},[3876],{"type":612,"value":733},{"type":606,"tag":644,"props":3878,"children":3879},{"class":646,"line":217},[3880,3884,3888,3892,3896,3900],{"type":606,"tag":644,"props":3881,"children":3882},{"style":650},[3883],{"type":612,"value":3661},{"type":606,"tag":644,"props":3885,"children":3886},{"style":656},[3887],{"type":612,"value":3666},{"type":606,"tag":644,"props":3889,"children":3890},{"style":650},[3891],{"type":612,"value":1077},{"type":606,"tag":644,"props":3893,"children":3894},{"style":707},[3895],{"type":612,"value":3675},{"type":606,"tag":644,"props":3897,"children":3898},{"style":656},[3899],{"type":612,"value":3680},{"type":606,"tag":644,"props":3901,"children":3902},{"style":683},[3903],{"type":612,"value":3685},{"type":606,"tag":644,"props":3905,"children":3906},{"class":646,"line":227},[3907,3912,3916],{"type":606,"tag":644,"props":3908,"children":3909},{"style":656},[3910],{"type":612,"value":3911},"            days_added ",{"type":606,"tag":644,"props":3913,"children":3914},{"style":650},[3915],{"type":612,"value":3698},{"type":606,"tag":644,"props":3917,"children":3918},{"style":707},[3919],{"type":612,"value":3703},{"type":606,"tag":644,"props":3921,"children":3922},{"class":646,"line":236},[3923],{"type":606,"tag":644,"props":3924,"children":3925},{"style":656},[3926],{"type":612,"value":2795},{"type":606,"tag":644,"props":3928,"children":3929},{"class":646,"line":245},[3930,3934],{"type":606,"tag":644,"props":3931,"children":3932},{"style":650},[3933],{"type":612,"value":3215},{"type":606,"tag":644,"props":3935,"children":3936},{"style":656},[3937],{"type":612,"value":3938}," current_date\n",{"type":606,"tag":644,"props":3940,"children":3941},{"class":646,"line":254},[3942],{"type":606,"tag":644,"props":3943,"children":3944},{"emptyLinePlaceholder":13},[3945],{"type":612,"value":677},{"type":606,"tag":644,"props":3947,"children":3948},{"class":646,"line":263},[3949],{"type":606,"tag":644,"props":3950,"children":3951},{"style":683},[3952],{"type":612,"value":3260},{"type":606,"tag":644,"props":3954,"children":3955},{"class":646,"line":272},[3956,3961,3965,3969,3973,3977,3981,3985,3989,3994],{"type":606,"tag":644,"props":3957,"children":3958},{"style":656},[3959],{"type":612,"value":3960},"start ",{"type":606,"tag":644,"props":3962,"children":3963},{"style":650},[3964],{"type":612,"value":699},{"type":606,"tag":644,"props":3966,"children":3967},{"style":656},[3968],{"type":612,"value":704},{"type":606,"tag":644,"props":3970,"children":3971},{"style":707},[3972],{"type":612,"value":710},{"type":606,"tag":644,"props":3974,"children":3975},{"style":656},[3976],{"type":612,"value":715},{"type":606,"tag":644,"props":3978,"children":3979},{"style":707},[3980],{"type":612,"value":762},{"type":606,"tag":644,"props":3982,"children":3983},{"style":656},[3984],{"type":612,"value":715},{"type":606,"tag":644,"props":3986,"children":3987},{"style":707},[3988],{"type":612,"value":771},{"type":606,"tag":644,"props":3990,"children":3991},{"style":656},[3992],{"type":612,"value":3993},")  ",{"type":606,"tag":644,"props":3995,"children":3996},{"style":683},[3997],{"type":612,"value":3998},"# Assuming it's a weekday\n",{"type":606,"tag":644,"props":4000,"children":4001},{"class":646,"line":281},[4002,4007,4011,4015,4019,4023,4027,4031,4036],{"type":606,"tag":644,"props":4003,"children":4004},{"style":656},[4005],{"type":612,"value":4006},"end ",{"type":606,"tag":644,"props":4008,"children":4009},{"style":650},[4010],{"type":612,"value":699},{"type":606,"tag":644,"props":4012,"children":4013},{"style":656},[4014],{"type":612,"value":704},{"type":606,"tag":644,"props":4016,"children":4017},{"style":707},[4018],{"type":612,"value":710},{"type":606,"tag":644,"props":4020,"children":4021},{"style":656},[4022],{"type":612,"value":715},{"type":606,"tag":644,"props":4024,"children":4025},{"style":707},[4026],{"type":612,"value":762},{"type":606,"tag":644,"props":4028,"children":4029},{"style":656},[4030],{"type":612,"value":715},{"type":606,"tag":644,"props":4032,"children":4033},{"style":707},[4034],{"type":612,"value":4035},"25",{"type":606,"tag":644,"props":4037,"children":4038},{"style":656},[4039],{"type":612,"value":733},{"type":606,"tag":644,"props":4041,"children":4042},{"class":646,"line":291},[4043],{"type":606,"tag":644,"props":4044,"children":4045},{"emptyLinePlaceholder":13},[4046],{"type":612,"value":677},{"type":606,"tag":644,"props":4048,"children":4049},{"class":646,"line":302},[4050,4055,4059],{"type":606,"tag":644,"props":4051,"children":4052},{"style":656},[4053],{"type":612,"value":4054},"biz_days ",{"type":606,"tag":644,"props":4056,"children":4057},{"style":650},[4058],{"type":612,"value":699},{"type":606,"tag":644,"props":4060,"children":4061},{"style":656},[4062],{"type":612,"value":4063}," count_business_days(start, end)\n",{"type":606,"tag":644,"props":4065,"children":4066},{"class":646,"line":311},[4067,4071,4075,4079,4084,4088,4093,4097,4102,4106,4111,4115,4120,4124,4129,4133,4137],{"type":606,"tag":644,"props":4068,"children":4069},{"style":707},[4070],{"type":612,"value":817},{"type":606,"tag":644,"props":4072,"children":4073},{"style":656},[4074],{"type":612,"value":822},{"type":606,"tag":644,"props":4076,"children":4077},{"style":650},[4078],{"type":612,"value":827},{"type":606,"tag":644,"props":4080,"children":4081},{"style":830},[4082],{"type":612,"value":4083},"\"Business days between ",{"type":606,"tag":644,"props":4085,"children":4086},{"style":707},[4087],{"type":612,"value":838},{"type":606,"tag":644,"props":4089,"children":4090},{"style":656},[4091],{"type":612,"value":4092},"start.date()",{"type":606,"tag":644,"props":4094,"children":4095},{"style":707},[4096],{"type":612,"value":848},{"type":606,"tag":644,"props":4098,"children":4099},{"style":830},[4100],{"type":612,"value":4101}," and ",{"type":606,"tag":644,"props":4103,"children":4104},{"style":707},[4105],{"type":612,"value":838},{"type":606,"tag":644,"props":4107,"children":4108},{"style":656},[4109],{"type":612,"value":4110},"end.date()",{"type":606,"tag":644,"props":4112,"children":4113},{"style":707},[4114],{"type":612,"value":848},{"type":606,"tag":644,"props":4116,"children":4117},{"style":830},[4118],{"type":612,"value":4119},": ",{"type":606,"tag":644,"props":4121,"children":4122},{"style":707},[4123],{"type":612,"value":838},{"type":606,"tag":644,"props":4125,"children":4126},{"style":656},[4127],{"type":612,"value":4128},"biz_days",{"type":606,"tag":644,"props":4130,"children":4131},{"style":707},[4132],{"type":612,"value":848},{"type":606,"tag":644,"props":4134,"children":4135},{"style":830},[4136],{"type":612,"value":853},{"type":606,"tag":644,"props":4138,"children":4139},{"style":656},[4140],{"type":612,"value":733},{"type":606,"tag":644,"props":4142,"children":4143},{"class":646,"line":320},[4144],{"type":606,"tag":644,"props":4145,"children":4146},{"emptyLinePlaceholder":13},[4147],{"type":612,"value":677},{"type":606,"tag":644,"props":4149,"children":4150},{"class":646,"line":329},[4151,4156,4160,4165,4170],{"type":606,"tag":644,"props":4152,"children":4153},{"style":656},[4154],{"type":612,"value":4155},"future_biz_date ",{"type":606,"tag":644,"props":4157,"children":4158},{"style":650},[4159],{"type":612,"value":699},{"type":606,"tag":644,"props":4161,"children":4162},{"style":656},[4163],{"type":612,"value":4164}," add_business_days(start, ",{"type":606,"tag":644,"props":4166,"children":4167},{"style":707},[4168],{"type":612,"value":4169},"10",{"type":606,"tag":644,"props":4171,"children":4172},{"style":656},[4173],{"type":612,"value":733},{"type":606,"tag":644,"props":4175,"children":4176},{"class":646,"line":338},[4177,4181,4185,4189,4194,4198,4202,4206,4210,4214,4219,4223,4227],{"type":606,"tag":644,"props":4178,"children":4179},{"style":707},[4180],{"type":612,"value":817},{"type":606,"tag":644,"props":4182,"children":4183},{"style":656},[4184],{"type":612,"value":822},{"type":606,"tag":644,"props":4186,"children":4187},{"style":650},[4188],{"type":612,"value":827},{"type":606,"tag":644,"props":4190,"children":4191},{"style":830},[4192],{"type":612,"value":4193},"\"10 business days after ",{"type":606,"tag":644,"props":4195,"children":4196},{"style":707},[4197],{"type":612,"value":838},{"type":606,"tag":644,"props":4199,"children":4200},{"style":656},[4201],{"type":612,"value":4092},{"type":606,"tag":644,"props":4203,"children":4204},{"style":707},[4205],{"type":612,"value":848},{"type":606,"tag":644,"props":4207,"children":4208},{"style":830},[4209],{"type":612,"value":4119},{"type":606,"tag":644,"props":4211,"children":4212},{"style":707},[4213],{"type":612,"value":838},{"type":606,"tag":644,"props":4215,"children":4216},{"style":656},[4217],{"type":612,"value":4218},"future_biz_date.date()",{"type":606,"tag":644,"props":4220,"children":4221},{"style":707},[4222],{"type":612,"value":848},{"type":606,"tag":644,"props":4224,"children":4225},{"style":830},[4226],{"type":612,"value":853},{"type":606,"tag":644,"props":4228,"children":4229},{"style":656},[4230],{"type":612,"value":733},{"type":606,"tag":1119,"props":4232,"children":4234},{"id":4233},"time-untilsince-events",[4235],{"type":612,"value":4236},"Time Until/Since Events",{"type":606,"tag":630,"props":4238,"children":4239},{},[4240],{"type":606,"tag":634,"props":4241,"children":4243},{"className":636,"code":4242,"language":638,"meta":8,"style":8},"from datetime import datetime, timedelta\n\ndef time_until_event(event_date):\n    \"\"\"Calculate time remaining until an event\"\"\"\n    now = datetime.now()\n    if event_date > now:\n        diff = event_date - now\n        return f\"Time until event: {format_duration(diff)}\"\n    else:\n        diff = now - event_date\n        return f\"Event was {format_duration(diff)} ago\"\n\ndef format_duration(td):\n    \"\"\"Simple duration formatter\"\"\"\n    days = td.days\n    hours = td.seconds // 3600\n    minutes = (td.seconds % 3600) // 60\n    \n    if days > 0:\n        return f\"{days} days, {hours} hours\"\n    elif hours > 0:\n        return f\"{hours} hours, {minutes} minutes\"\n    else:\n        return f\"{minutes} minutes\"\n\n# Example events\nevents = [\n    (\"New Year 2025\", datetime(2025, 1, 1)),\n    (\"Yesterday\", datetime.now() - timedelta(days=1)),\n    (\"Next Week\", datetime.now() + timedelta(weeks=1))\n]\n\nfor name, date in events:\n    print(f\"{name}: {time_until_event(date)}\")\n",[4244],{"type":606,"tag":621,"props":4245,"children":4246},{"__ignoreMap":8},[4247,4266,4273,4290,4298,4314,4335,4359,4395,4408,4432,4465,4472,4487,4495,4510,4535,4572,4579,4603,4652,4676,4725,4736,4767,4774,4782,4798,4842,4883,4924,4931,4938,4959],{"type":606,"tag":644,"props":4248,"children":4249},{"class":646,"line":12},[4250,4254,4258,4262],{"type":606,"tag":644,"props":4251,"children":4252},{"style":650},[4253],{"type":612,"value":653},{"type":606,"tag":644,"props":4255,"children":4256},{"style":656},[4257],{"type":612,"value":659},{"type":606,"tag":644,"props":4259,"children":4260},{"style":650},[4261],{"type":612,"value":664},{"type":606,"tag":644,"props":4263,"children":4264},{"style":656},[4265],{"type":612,"value":669},{"type":606,"tag":644,"props":4267,"children":4268},{"class":646,"line":27},[4269],{"type":606,"tag":644,"props":4270,"children":4271},{"emptyLinePlaceholder":13},[4272],{"type":612,"value":677},{"type":606,"tag":644,"props":4274,"children":4275},{"class":646,"line":36},[4276,4280,4285],{"type":606,"tag":644,"props":4277,"children":4278},{"style":650},[4279],{"type":612,"value":2634},{"type":606,"tag":644,"props":4281,"children":4282},{"style":2637},[4283],{"type":612,"value":4284}," time_until_event",{"type":606,"tag":644,"props":4286,"children":4287},{"style":656},[4288],{"type":612,"value":4289},"(event_date):\n",{"type":606,"tag":644,"props":4291,"children":4292},{"class":646,"line":45},[4293],{"type":606,"tag":644,"props":4294,"children":4295},{"style":830},[4296],{"type":612,"value":4297},"    \"\"\"Calculate time remaining until an event\"\"\"\n",{"type":606,"tag":644,"props":4299,"children":4300},{"class":646,"line":54},[4301,4306,4310],{"type":606,"tag":644,"props":4302,"children":4303},{"style":656},[4304],{"type":612,"value":4305},"    now ",{"type":606,"tag":644,"props":4307,"children":4308},{"style":650},[4309],{"type":612,"value":699},{"type":606,"tag":644,"props":4311,"children":4312},{"style":656},[4313],{"type":612,"value":1177},{"type":606,"tag":644,"props":4315,"children":4316},{"class":646,"line":63},[4317,4321,4326,4330],{"type":606,"tag":644,"props":4318,"children":4319},{"style":650},[4320],{"type":612,"value":2820},{"type":606,"tag":644,"props":4322,"children":4323},{"style":656},[4324],{"type":612,"value":4325}," event_date ",{"type":606,"tag":644,"props":4327,"children":4328},{"style":650},[4329],{"type":612,"value":1084},{"type":606,"tag":644,"props":4331,"children":4332},{"style":656},[4333],{"type":612,"value":4334}," now:\n",{"type":606,"tag":644,"props":4336,"children":4337},{"class":646,"line":72},[4338,4343,4347,4351,4355],{"type":606,"tag":644,"props":4339,"children":4340},{"style":656},[4341],{"type":612,"value":4342},"        diff ",{"type":606,"tag":644,"props":4344,"children":4345},{"style":650},[4346],{"type":612,"value":699},{"type":606,"tag":644,"props":4348,"children":4349},{"style":656},[4350],{"type":612,"value":4325},{"type":606,"tag":644,"props":4352,"children":4353},{"style":650},[4354],{"type":612,"value":804},{"type":606,"tag":644,"props":4356,"children":4357},{"style":656},[4358],{"type":612,"value":1508},{"type":606,"tag":644,"props":4360,"children":4361},{"class":646,"line":81},[4362,4367,4372,4377,4381,4386,4390],{"type":606,"tag":644,"props":4363,"children":4364},{"style":650},[4365],{"type":612,"value":4366},"        return",{"type":606,"tag":644,"props":4368,"children":4369},{"style":650},[4370],{"type":612,"value":4371}," f",{"type":606,"tag":644,"props":4373,"children":4374},{"style":830},[4375],{"type":612,"value":4376},"\"Time until event: ",{"type":606,"tag":644,"props":4378,"children":4379},{"style":707},[4380],{"type":612,"value":838},{"type":606,"tag":644,"props":4382,"children":4383},{"style":656},[4384],{"type":612,"value":4385},"format_duration(diff)",{"type":606,"tag":644,"props":4387,"children":4388},{"style":707},[4389],{"type":612,"value":848},{"type":606,"tag":644,"props":4391,"children":4392},{"style":830},[4393],{"type":612,"value":4394},"\"\n",{"type":606,"tag":644,"props":4396,"children":4397},{"class":646,"line":860},[4398,4403],{"type":606,"tag":644,"props":4399,"children":4400},{"style":650},[4401],{"type":612,"value":4402},"    else",{"type":606,"tag":644,"props":4404,"children":4405},{"style":656},[4406],{"type":612,"value":4407},":\n",{"type":606,"tag":644,"props":4409,"children":4410},{"class":646,"line":99},[4411,4415,4419,4423,4427],{"type":606,"tag":644,"props":4412,"children":4413},{"style":656},[4414],{"type":612,"value":4342},{"type":606,"tag":644,"props":4416,"children":4417},{"style":650},[4418],{"type":612,"value":699},{"type":606,"tag":644,"props":4420,"children":4421},{"style":656},[4422],{"type":612,"value":1250},{"type":606,"tag":644,"props":4424,"children":4425},{"style":650},[4426],{"type":612,"value":804},{"type":606,"tag":644,"props":4428,"children":4429},{"style":656},[4430],{"type":612,"value":4431}," event_date\n",{"type":606,"tag":644,"props":4433,"children":4434},{"class":646,"line":108},[4435,4439,4443,4448,4452,4456,4460],{"type":606,"tag":644,"props":4436,"children":4437},{"style":650},[4438],{"type":612,"value":4366},{"type":606,"tag":644,"props":4440,"children":4441},{"style":650},[4442],{"type":612,"value":4371},{"type":606,"tag":644,"props":4444,"children":4445},{"style":830},[4446],{"type":612,"value":4447},"\"Event was ",{"type":606,"tag":644,"props":4449,"children":4450},{"style":707},[4451],{"type":612,"value":838},{"type":606,"tag":644,"props":4453,"children":4454},{"style":656},[4455],{"type":612,"value":4385},{"type":606,"tag":644,"props":4457,"children":4458},{"style":707},[4459],{"type":612,"value":848},{"type":606,"tag":644,"props":4461,"children":4462},{"style":830},[4463],{"type":612,"value":4464}," ago\"\n",{"type":606,"tag":644,"props":4466,"children":4467},{"class":646,"line":117},[4468],{"type":606,"tag":644,"props":4469,"children":4470},{"emptyLinePlaceholder":13},[4471],{"type":612,"value":677},{"type":606,"tag":644,"props":4473,"children":4474},{"class":646,"line":126},[4475,4479,4483],{"type":606,"tag":644,"props":4476,"children":4477},{"style":650},[4478],{"type":612,"value":2634},{"type":606,"tag":644,"props":4480,"children":4481},{"style":2637},[4482],{"type":612,"value":2640},{"type":606,"tag":644,"props":4484,"children":4485},{"style":656},[4486],{"type":612,"value":2645},{"type":606,"tag":644,"props":4488,"children":4489},{"class":646,"line":135},[4490],{"type":606,"tag":644,"props":4491,"children":4492},{"style":830},[4493],{"type":612,"value":4494},"    \"\"\"Simple duration formatter\"\"\"\n",{"type":606,"tag":644,"props":4496,"children":4497},{"class":646,"line":144},[4498,4502,4506],{"type":606,"tag":644,"props":4499,"children":4500},{"style":656},[4501],{"type":612,"value":2683},{"type":606,"tag":644,"props":4503,"children":4504},{"style":650},[4505],{"type":612,"value":699},{"type":606,"tag":644,"props":4507,"children":4508},{"style":656},[4509],{"type":612,"value":2692},{"type":606,"tag":644,"props":4511,"children":4512},{"class":646,"line":153},[4513,4517,4521,4526,4530],{"type":606,"tag":644,"props":4514,"children":4515},{"style":656},[4516],{"type":612,"value":2700},{"type":606,"tag":644,"props":4518,"children":4519},{"style":650},[4520],{"type":612,"value":699},{"type":606,"tag":644,"props":4522,"children":4523},{"style":656},[4524],{"type":612,"value":4525}," td.seconds ",{"type":606,"tag":644,"props":4527,"children":4528},{"style":650},[4529],{"type":612,"value":2334},{"type":606,"tag":644,"props":4531,"children":4532},{"style":707},[4533],{"type":612,"value":4534}," 3600\n",{"type":606,"tag":644,"props":4536,"children":4537},{"class":646,"line":163},[4538,4542,4546,4551,4555,4559,4564,4568],{"type":606,"tag":644,"props":4539,"children":4540},{"style":656},[4541],{"type":612,"value":2736},{"type":606,"tag":644,"props":4543,"children":4544},{"style":650},[4545],{"type":612,"value":699},{"type":606,"tag":644,"props":4547,"children":4548},{"style":656},[4549],{"type":612,"value":4550}," (td.seconds ",{"type":606,"tag":644,"props":4552,"children":4553},{"style":650},[4554],{"type":612,"value":2783},{"type":606,"tag":644,"props":4556,"children":4557},{"style":707},[4558],{"type":612,"value":2718},{"type":606,"tag":644,"props":4560,"children":4561},{"style":656},[4562],{"type":612,"value":4563},") ",{"type":606,"tag":644,"props":4565,"children":4566},{"style":650},[4567],{"type":612,"value":2334},{"type":606,"tag":644,"props":4569,"children":4570},{"style":707},[4571],{"type":612,"value":2762},{"type":606,"tag":644,"props":4573,"children":4574},{"class":646,"line":172},[4575],{"type":606,"tag":644,"props":4576,"children":4577},{"style":656},[4578],{"type":612,"value":2795},{"type":606,"tag":644,"props":4580,"children":4581},{"class":646,"line":181},[4582,4586,4590,4594,4599],{"type":606,"tag":644,"props":4583,"children":4584},{"style":650},[4585],{"type":612,"value":2820},{"type":606,"tag":644,"props":4587,"children":4588},{"style":656},[4589],{"type":612,"value":2877},{"type":606,"tag":644,"props":4591,"children":4592},{"style":650},[4593],{"type":612,"value":1084},{"type":606,"tag":644,"props":4595,"children":4596},{"style":707},[4597],{"type":612,"value":4598}," 0",{"type":606,"tag":644,"props":4600,"children":4601},{"style":656},[4602],{"type":612,"value":4407},{"type":606,"tag":644,"props":4604,"children":4605},{"class":646,"line":190},[4606,4610,4614,4618,4622,4626,4630,4635,4639,4643,4647],{"type":606,"tag":644,"props":4607,"children":4608},{"style":650},[4609],{"type":612,"value":4366},{"type":606,"tag":644,"props":4611,"children":4612},{"style":650},[4613],{"type":612,"value":4371},{"type":606,"tag":644,"props":4615,"children":4616},{"style":830},[4617],{"type":612,"value":853},{"type":606,"tag":644,"props":4619,"children":4620},{"style":707},[4621],{"type":612,"value":838},{"type":606,"tag":644,"props":4623,"children":4624},{"style":656},[4625],{"type":612,"value":982},{"type":606,"tag":644,"props":4627,"children":4628},{"style":707},[4629],{"type":612,"value":848},{"type":606,"tag":644,"props":4631,"children":4632},{"style":830},[4633],{"type":612,"value":4634}," days, ",{"type":606,"tag":644,"props":4636,"children":4637},{"style":707},[4638],{"type":612,"value":838},{"type":606,"tag":644,"props":4640,"children":4641},{"style":656},[4642],{"type":612,"value":1282},{"type":606,"tag":644,"props":4644,"children":4645},{"style":707},[4646],{"type":612,"value":848},{"type":606,"tag":644,"props":4648,"children":4649},{"style":830},[4650],{"type":612,"value":4651}," hours\"\n",{"type":606,"tag":644,"props":4653,"children":4654},{"class":646,"line":199},[4655,4660,4664,4668,4672],{"type":606,"tag":644,"props":4656,"children":4657},{"style":650},[4658],{"type":612,"value":4659},"    elif",{"type":606,"tag":644,"props":4661,"children":4662},{"style":656},[4663],{"type":612,"value":2970},{"type":606,"tag":644,"props":4665,"children":4666},{"style":650},[4667],{"type":612,"value":1084},{"type":606,"tag":644,"props":4669,"children":4670},{"style":707},[4671],{"type":612,"value":4598},{"type":606,"tag":644,"props":4673,"children":4674},{"style":656},[4675],{"type":612,"value":4407},{"type":606,"tag":644,"props":4677,"children":4678},{"class":646,"line":208},[4679,4683,4687,4691,4695,4699,4703,4708,4712,4716,4720],{"type":606,"tag":644,"props":4680,"children":4681},{"style":650},[4682],{"type":612,"value":4366},{"type":606,"tag":644,"props":4684,"children":4685},{"style":650},[4686],{"type":612,"value":4371},{"type":606,"tag":644,"props":4688,"children":4689},{"style":830},[4690],{"type":612,"value":853},{"type":606,"tag":644,"props":4692,"children":4693},{"style":707},[4694],{"type":612,"value":838},{"type":606,"tag":644,"props":4696,"children":4697},{"style":656},[4698],{"type":612,"value":1282},{"type":606,"tag":644,"props":4700,"children":4701},{"style":707},[4702],{"type":612,"value":848},{"type":606,"tag":644,"props":4704,"children":4705},{"style":830},[4706],{"type":612,"value":4707}," hours, ",{"type":606,"tag":644,"props":4709,"children":4710},{"style":707},[4711],{"type":612,"value":838},{"type":606,"tag":644,"props":4713,"children":4714},{"style":656},[4715],{"type":612,"value":1299},{"type":606,"tag":644,"props":4717,"children":4718},{"style":707},[4719],{"type":612,"value":848},{"type":606,"tag":644,"props":4721,"children":4722},{"style":830},[4723],{"type":612,"value":4724}," minutes\"\n",{"type":606,"tag":644,"props":4726,"children":4727},{"class":646,"line":217},[4728,4732],{"type":606,"tag":644,"props":4729,"children":4730},{"style":650},[4731],{"type":612,"value":4402},{"type":606,"tag":644,"props":4733,"children":4734},{"style":656},[4735],{"type":612,"value":4407},{"type":606,"tag":644,"props":4737,"children":4738},{"class":646,"line":227},[4739,4743,4747,4751,4755,4759,4763],{"type":606,"tag":644,"props":4740,"children":4741},{"style":650},[4742],{"type":612,"value":4366},{"type":606,"tag":644,"props":4744,"children":4745},{"style":650},[4746],{"type":612,"value":4371},{"type":606,"tag":644,"props":4748,"children":4749},{"style":830},[4750],{"type":612,"value":853},{"type":606,"tag":644,"props":4752,"children":4753},{"style":707},[4754],{"type":612,"value":838},{"type":606,"tag":644,"props":4756,"children":4757},{"style":656},[4758],{"type":612,"value":1299},{"type":606,"tag":644,"props":4760,"children":4761},{"style":707},[4762],{"type":612,"value":848},{"type":606,"tag":644,"props":4764,"children":4765},{"style":830},[4766],{"type":612,"value":4724},{"type":606,"tag":644,"props":4768,"children":4769},{"class":646,"line":236},[4770],{"type":606,"tag":644,"props":4771,"children":4772},{"emptyLinePlaceholder":13},[4773],{"type":612,"value":677},{"type":606,"tag":644,"props":4775,"children":4776},{"class":646,"line":245},[4777],{"type":606,"tag":644,"props":4778,"children":4779},{"style":683},[4780],{"type":612,"value":4781},"# Example events\n",{"type":606,"tag":644,"props":4783,"children":4784},{"class":646,"line":254},[4785,4790,4794],{"type":606,"tag":644,"props":4786,"children":4787},{"style":656},[4788],{"type":612,"value":4789},"events ",{"type":606,"tag":644,"props":4791,"children":4792},{"style":650},[4793],{"type":612,"value":699},{"type":606,"tag":644,"props":4795,"children":4796},{"style":656},[4797],{"type":612,"value":3277},{"type":606,"tag":644,"props":4799,"children":4800},{"class":646,"line":263},[4801,4806,4811,4816,4821,4825,4829,4833,4837],{"type":606,"tag":644,"props":4802,"children":4803},{"style":656},[4804],{"type":612,"value":4805},"    (",{"type":606,"tag":644,"props":4807,"children":4808},{"style":830},[4809],{"type":612,"value":4810},"\"New Year 2025\"",{"type":606,"tag":644,"props":4812,"children":4813},{"style":656},[4814],{"type":612,"value":4815},", datetime(",{"type":606,"tag":644,"props":4817,"children":4818},{"style":707},[4819],{"type":612,"value":4820},"2025",{"type":606,"tag":644,"props":4822,"children":4823},{"style":656},[4824],{"type":612,"value":715},{"type":606,"tag":644,"props":4826,"children":4827},{"style":707},[4828],{"type":612,"value":720},{"type":606,"tag":644,"props":4830,"children":4831},{"style":656},[4832],{"type":612,"value":715},{"type":606,"tag":644,"props":4834,"children":4835},{"style":707},[4836],{"type":612,"value":720},{"type":606,"tag":644,"props":4838,"children":4839},{"style":656},[4840],{"type":612,"value":4841},")),\n",{"type":606,"tag":644,"props":4843,"children":4844},{"class":646,"line":272},[4845,4849,4854,4859,4863,4867,4871,4875,4879],{"type":606,"tag":644,"props":4846,"children":4847},{"style":656},[4848],{"type":612,"value":4805},{"type":606,"tag":644,"props":4850,"children":4851},{"style":830},[4852],{"type":612,"value":4853},"\"Yesterday\"",{"type":606,"tag":644,"props":4855,"children":4856},{"style":656},[4857],{"type":612,"value":4858},", datetime.now() ",{"type":606,"tag":644,"props":4860,"children":4861},{"style":650},[4862],{"type":612,"value":804},{"type":606,"tag":644,"props":4864,"children":4865},{"style":656},[4866],{"type":612,"value":1259},{"type":606,"tag":644,"props":4868,"children":4869},{"style":1262},[4870],{"type":612,"value":982},{"type":606,"tag":644,"props":4872,"children":4873},{"style":650},[4874],{"type":612,"value":699},{"type":606,"tag":644,"props":4876,"children":4877},{"style":707},[4878],{"type":612,"value":720},{"type":606,"tag":644,"props":4880,"children":4881},{"style":656},[4882],{"type":612,"value":4841},{"type":606,"tag":644,"props":4884,"children":4885},{"class":646,"line":281},[4886,4890,4895,4899,4903,4907,4911,4915,4919],{"type":606,"tag":644,"props":4887,"children":4888},{"style":656},[4889],{"type":612,"value":4805},{"type":606,"tag":644,"props":4891,"children":4892},{"style":830},[4893],{"type":612,"value":4894},"\"Next Week\"",{"type":606,"tag":644,"props":4896,"children":4897},{"style":656},[4898],{"type":612,"value":4858},{"type":606,"tag":644,"props":4900,"children":4901},{"style":650},[4902],{"type":612,"value":1039},{"type":606,"tag":644,"props":4904,"children":4905},{"style":656},[4906],{"type":612,"value":1259},{"type":606,"tag":644,"props":4908,"children":4909},{"style":1262},[4910],{"type":612,"value":1397},{"type":606,"tag":644,"props":4912,"children":4913},{"style":650},[4914],{"type":612,"value":699},{"type":606,"tag":644,"props":4916,"children":4917},{"style":707},[4918],{"type":612,"value":720},{"type":606,"tag":644,"props":4920,"children":4921},{"style":656},[4922],{"type":612,"value":4923},"))\n",{"type":606,"tag":644,"props":4925,"children":4926},{"class":646,"line":291},[4927],{"type":606,"tag":644,"props":4928,"children":4929},{"style":656},[4930],{"type":612,"value":3427},{"type":606,"tag":644,"props":4932,"children":4933},{"class":646,"line":302},[4934],{"type":606,"tag":644,"props":4935,"children":4936},{"emptyLinePlaceholder":13},[4937],{"type":612,"value":677},{"type":606,"tag":644,"props":4939,"children":4940},{"class":646,"line":311},[4941,4945,4950,4954],{"type":606,"tag":644,"props":4942,"children":4943},{"style":650},[4944],{"type":612,"value":3442},{"type":606,"tag":644,"props":4946,"children":4947},{"style":656},[4948],{"type":612,"value":4949}," name, date ",{"type":606,"tag":644,"props":4951,"children":4952},{"style":650},[4953],{"type":612,"value":3452},{"type":606,"tag":644,"props":4955,"children":4956},{"style":656},[4957],{"type":612,"value":4958}," events:\n",{"type":606,"tag":644,"props":4960,"children":4961},{"class":646,"line":320},[4962,4966,4970,4974,4978,4982,4987,4991,4995,4999,5004,5008,5012],{"type":606,"tag":644,"props":4963,"children":4964},{"style":707},[4965],{"type":612,"value":3465},{"type":606,"tag":644,"props":4967,"children":4968},{"style":656},[4969],{"type":612,"value":822},{"type":606,"tag":644,"props":4971,"children":4972},{"style":650},[4973],{"type":612,"value":827},{"type":606,"tag":644,"props":4975,"children":4976},{"style":830},[4977],{"type":612,"value":853},{"type":606,"tag":644,"props":4979,"children":4980},{"style":707},[4981],{"type":612,"value":838},{"type":606,"tag":644,"props":4983,"children":4984},{"style":656},[4985],{"type":612,"value":4986},"name",{"type":606,"tag":644,"props":4988,"children":4989},{"style":707},[4990],{"type":612,"value":848},{"type":606,"tag":644,"props":4992,"children":4993},{"style":830},[4994],{"type":612,"value":4119},{"type":606,"tag":644,"props":4996,"children":4997},{"style":707},[4998],{"type":612,"value":838},{"type":606,"tag":644,"props":5000,"children":5001},{"style":656},[5002],{"type":612,"value":5003},"time_until_event(date)",{"type":606,"tag":644,"props":5005,"children":5006},{"style":707},[5007],{"type":612,"value":848},{"type":606,"tag":644,"props":5009,"children":5010},{"style":830},[5011],{"type":612,"value":853},{"type":606,"tag":644,"props":5013,"children":5014},{"style":656},[5015],{"type":612,"value":733},{"type":606,"tag":942,"props":5017,"children":5019},{"id":5018},"advanced-time-calculations",[5020],{"type":612,"value":5021},"📈 Advanced Time Calculations",{"type":606,"tag":615,"props":5023,"children":5024},{},[5025],{"type":612,"value":5026},"More sophisticated time difference calculations.",{"type":606,"tag":1119,"props":5028,"children":5030},{"id":5029},"working-hours-calculator",[5031],{"type":612,"value":5032},"Working Hours Calculator",{"type":606,"tag":630,"props":5034,"children":5035},{},[5036],{"type":606,"tag":634,"props":5037,"children":5039},{"className":636,"code":5038,"language":638,"meta":8,"style":8},"from datetime import datetime, time, timedelta\n\ndef calculate_working_hours(start_datetime, end_datetime, \n                          work_start=time(9, 0), work_end=time(17, 0)):\n    \"\"\"Calculate working hours between two datetimes\"\"\"\n    total_hours = 0\n    current_date = start_datetime.date()\n    end_date = end_datetime.date()\n    \n    while current_date \u003C= end_date:\n        # Skip weekends\n        if current_date.weekday() >= 5:\n            current_date += timedelta(days=1)\n            continue\n        \n        # Determine work period for this day\n        day_start = datetime.combine(current_date, work_start)\n        day_end = datetime.combine(current_date, work_end)\n        \n        # Adjust for actual start/end times\n        period_start = max(day_start, start_datetime)\n        period_end = min(day_end, end_datetime)\n        \n        # Add hours if there's overlap\n        if period_start \u003C period_end:\n            hours = (period_end - period_start).total_seconds() / 3600\n            total_hours += hours\n        \n        current_date += timedelta(days=1)\n    \n    return total_hours\n\n# Example usage\nproject_start = datetime(2024, 3, 15, 14, 30)  # Friday 2:30 PM\nproject_end = datetime(2024, 3, 18, 11, 0)     # Monday 11:00 AM\n\nworking_hours = calculate_working_hours(project_start, project_end)\nprint(f\"Total working hours: {working_hours:.2f}\")\n",[5040],{"type":606,"tag":621,"props":5041,"children":5042},{"__ignoreMap":8},[5043,5063,5070,5087,5149,5157,5173,5189,5206,5213,5233,5241,5265,5297,5305,5313,5321,5338,5355,5362,5370,5392,5414,5421,5429,5450,5484,5501,5508,5539,5546,5558,5565,5572,5633,5696,5703,5720],{"type":606,"tag":644,"props":5044,"children":5045},{"class":646,"line":12},[5046,5050,5054,5058],{"type":606,"tag":644,"props":5047,"children":5048},{"style":650},[5049],{"type":612,"value":653},{"type":606,"tag":644,"props":5051,"children":5052},{"style":656},[5053],{"type":612,"value":659},{"type":606,"tag":644,"props":5055,"children":5056},{"style":650},[5057],{"type":612,"value":664},{"type":606,"tag":644,"props":5059,"children":5060},{"style":656},[5061],{"type":612,"value":5062}," datetime, time, timedelta\n",{"type":606,"tag":644,"props":5064,"children":5065},{"class":646,"line":27},[5066],{"type":606,"tag":644,"props":5067,"children":5068},{"emptyLinePlaceholder":13},[5069],{"type":612,"value":677},{"type":606,"tag":644,"props":5071,"children":5072},{"class":646,"line":36},[5073,5077,5082],{"type":606,"tag":644,"props":5074,"children":5075},{"style":650},[5076],{"type":612,"value":2634},{"type":606,"tag":644,"props":5078,"children":5079},{"style":2637},[5080],{"type":612,"value":5081}," calculate_working_hours",{"type":606,"tag":644,"props":5083,"children":5084},{"style":656},[5085],{"type":612,"value":5086},"(start_datetime, end_datetime, \n",{"type":606,"tag":644,"props":5088,"children":5089},{"class":646,"line":45},[5090,5095,5099,5104,5109,5113,5118,5123,5127,5131,5136,5140,5144],{"type":606,"tag":644,"props":5091,"children":5092},{"style":656},[5093],{"type":612,"value":5094},"                          work_start",{"type":606,"tag":644,"props":5096,"children":5097},{"style":650},[5098],{"type":612,"value":699},{"type":606,"tag":644,"props":5100,"children":5101},{"style":656},[5102],{"type":612,"value":5103},"time(",{"type":606,"tag":644,"props":5105,"children":5106},{"style":707},[5107],{"type":612,"value":5108},"9",{"type":606,"tag":644,"props":5110,"children":5111},{"style":656},[5112],{"type":612,"value":715},{"type":606,"tag":644,"props":5114,"children":5115},{"style":707},[5116],{"type":612,"value":5117},"0",{"type":606,"tag":644,"props":5119,"children":5120},{"style":656},[5121],{"type":612,"value":5122},"), work_end",{"type":606,"tag":644,"props":5124,"children":5125},{"style":650},[5126],{"type":612,"value":699},{"type":606,"tag":644,"props":5128,"children":5129},{"style":656},[5130],{"type":612,"value":5103},{"type":606,"tag":644,"props":5132,"children":5133},{"style":707},[5134],{"type":612,"value":5135},"17",{"type":606,"tag":644,"props":5137,"children":5138},{"style":656},[5139],{"type":612,"value":715},{"type":606,"tag":644,"props":5141,"children":5142},{"style":707},[5143],{"type":612,"value":5117},{"type":606,"tag":644,"props":5145,"children":5146},{"style":656},[5147],{"type":612,"value":5148},")):\n",{"type":606,"tag":644,"props":5150,"children":5151},{"class":646,"line":54},[5152],{"type":606,"tag":644,"props":5153,"children":5154},{"style":830},[5155],{"type":612,"value":5156},"    \"\"\"Calculate working hours between two datetimes\"\"\"\n",{"type":606,"tag":644,"props":5158,"children":5159},{"class":646,"line":63},[5160,5165,5169],{"type":606,"tag":644,"props":5161,"children":5162},{"style":656},[5163],{"type":612,"value":5164},"    total_hours ",{"type":606,"tag":644,"props":5166,"children":5167},{"style":650},[5168],{"type":612,"value":699},{"type":606,"tag":644,"props":5170,"children":5171},{"style":707},[5172],{"type":612,"value":3600},{"type":606,"tag":644,"props":5174,"children":5175},{"class":646,"line":72},[5176,5180,5184],{"type":606,"tag":644,"props":5177,"children":5178},{"style":656},[5179],{"type":612,"value":3608},{"type":606,"tag":644,"props":5181,"children":5182},{"style":650},[5183],{"type":612,"value":699},{"type":606,"tag":644,"props":5185,"children":5186},{"style":656},[5187],{"type":612,"value":5188}," start_datetime.date()\n",{"type":606,"tag":644,"props":5190,"children":5191},{"class":646,"line":81},[5192,5197,5201],{"type":606,"tag":644,"props":5193,"children":5194},{"style":656},[5195],{"type":612,"value":5196},"    end_date ",{"type":606,"tag":644,"props":5198,"children":5199},{"style":650},[5200],{"type":612,"value":699},{"type":606,"tag":644,"props":5202,"children":5203},{"style":656},[5204],{"type":612,"value":5205}," end_datetime.date()\n",{"type":606,"tag":644,"props":5207,"children":5208},{"class":646,"line":860},[5209],{"type":606,"tag":644,"props":5210,"children":5211},{"style":656},[5212],{"type":612,"value":2795},{"type":606,"tag":644,"props":5214,"children":5215},{"class":646,"line":99},[5216,5220,5224,5229],{"type":606,"tag":644,"props":5217,"children":5218},{"style":650},[5219],{"type":612,"value":3631},{"type":606,"tag":644,"props":5221,"children":5222},{"style":656},[5223],{"type":612,"value":3636},{"type":606,"tag":644,"props":5225,"children":5226},{"style":650},[5227],{"type":612,"value":5228},"\u003C=",{"type":606,"tag":644,"props":5230,"children":5231},{"style":656},[5232],{"type":612,"value":3645},{"type":606,"tag":644,"props":5234,"children":5235},{"class":646,"line":108},[5236],{"type":606,"tag":644,"props":5237,"children":5238},{"style":683},[5239],{"type":612,"value":5240},"        # Skip weekends\n",{"type":606,"tag":644,"props":5242,"children":5243},{"class":646,"line":117},[5244,5248,5252,5257,5261],{"type":606,"tag":644,"props":5245,"children":5246},{"style":650},[5247],{"type":612,"value":3661},{"type":606,"tag":644,"props":5249,"children":5250},{"style":656},[5251],{"type":612,"value":3666},{"type":606,"tag":644,"props":5253,"children":5254},{"style":650},[5255],{"type":612,"value":5256},">=",{"type":606,"tag":644,"props":5258,"children":5259},{"style":707},[5260],{"type":612,"value":3675},{"type":606,"tag":644,"props":5262,"children":5263},{"style":656},[5264],{"type":612,"value":4407},{"type":606,"tag":644,"props":5266,"children":5267},{"class":646,"line":126},[5268,5273,5277,5281,5285,5289,5293],{"type":606,"tag":644,"props":5269,"children":5270},{"style":656},[5271],{"type":612,"value":5272},"            current_date ",{"type":606,"tag":644,"props":5274,"children":5275},{"style":650},[5276],{"type":612,"value":3698},{"type":606,"tag":644,"props":5278,"children":5279},{"style":656},[5280],{"type":612,"value":1259},{"type":606,"tag":644,"props":5282,"children":5283},{"style":1262},[5284],{"type":612,"value":982},{"type":606,"tag":644,"props":5286,"children":5287},{"style":650},[5288],{"type":612,"value":699},{"type":606,"tag":644,"props":5290,"children":5291},{"style":707},[5292],{"type":612,"value":720},{"type":606,"tag":644,"props":5294,"children":5295},{"style":656},[5296],{"type":612,"value":733},{"type":606,"tag":644,"props":5298,"children":5299},{"class":646,"line":135},[5300],{"type":606,"tag":644,"props":5301,"children":5302},{"style":650},[5303],{"type":612,"value":5304},"            continue\n",{"type":606,"tag":644,"props":5306,"children":5307},{"class":646,"line":144},[5308],{"type":606,"tag":644,"props":5309,"children":5310},{"style":656},[5311],{"type":612,"value":5312},"        \n",{"type":606,"tag":644,"props":5314,"children":5315},{"class":646,"line":153},[5316],{"type":606,"tag":644,"props":5317,"children":5318},{"style":683},[5319],{"type":612,"value":5320},"        # Determine work period for this day\n",{"type":606,"tag":644,"props":5322,"children":5323},{"class":646,"line":163},[5324,5329,5333],{"type":606,"tag":644,"props":5325,"children":5326},{"style":656},[5327],{"type":612,"value":5328},"        day_start ",{"type":606,"tag":644,"props":5330,"children":5331},{"style":650},[5332],{"type":612,"value":699},{"type":606,"tag":644,"props":5334,"children":5335},{"style":656},[5336],{"type":612,"value":5337}," datetime.combine(current_date, work_start)\n",{"type":606,"tag":644,"props":5339,"children":5340},{"class":646,"line":172},[5341,5346,5350],{"type":606,"tag":644,"props":5342,"children":5343},{"style":656},[5344],{"type":612,"value":5345},"        day_end ",{"type":606,"tag":644,"props":5347,"children":5348},{"style":650},[5349],{"type":612,"value":699},{"type":606,"tag":644,"props":5351,"children":5352},{"style":656},[5353],{"type":612,"value":5354}," datetime.combine(current_date, work_end)\n",{"type":606,"tag":644,"props":5356,"children":5357},{"class":646,"line":181},[5358],{"type":606,"tag":644,"props":5359,"children":5360},{"style":656},[5361],{"type":612,"value":5312},{"type":606,"tag":644,"props":5363,"children":5364},{"class":646,"line":190},[5365],{"type":606,"tag":644,"props":5366,"children":5367},{"style":683},[5368],{"type":612,"value":5369},"        # Adjust for actual start/end times\n",{"type":606,"tag":644,"props":5371,"children":5372},{"class":646,"line":199},[5373,5378,5382,5387],{"type":606,"tag":644,"props":5374,"children":5375},{"style":656},[5376],{"type":612,"value":5377},"        period_start ",{"type":606,"tag":644,"props":5379,"children":5380},{"style":650},[5381],{"type":612,"value":699},{"type":606,"tag":644,"props":5383,"children":5384},{"style":707},[5385],{"type":612,"value":5386}," max",{"type":606,"tag":644,"props":5388,"children":5389},{"style":656},[5390],{"type":612,"value":5391},"(day_start, start_datetime)\n",{"type":606,"tag":644,"props":5393,"children":5394},{"class":646,"line":208},[5395,5400,5404,5409],{"type":606,"tag":644,"props":5396,"children":5397},{"style":656},[5398],{"type":612,"value":5399},"        period_end ",{"type":606,"tag":644,"props":5401,"children":5402},{"style":650},[5403],{"type":612,"value":699},{"type":606,"tag":644,"props":5405,"children":5406},{"style":707},[5407],{"type":612,"value":5408}," min",{"type":606,"tag":644,"props":5410,"children":5411},{"style":656},[5412],{"type":612,"value":5413},"(day_end, end_datetime)\n",{"type":606,"tag":644,"props":5415,"children":5416},{"class":646,"line":217},[5417],{"type":606,"tag":644,"props":5418,"children":5419},{"style":656},[5420],{"type":612,"value":5312},{"type":606,"tag":644,"props":5422,"children":5423},{"class":646,"line":227},[5424],{"type":606,"tag":644,"props":5425,"children":5426},{"style":683},[5427],{"type":612,"value":5428},"        # Add hours if there's overlap\n",{"type":606,"tag":644,"props":5430,"children":5431},{"class":646,"line":236},[5432,5436,5441,5445],{"type":606,"tag":644,"props":5433,"children":5434},{"style":650},[5435],{"type":612,"value":3661},{"type":606,"tag":644,"props":5437,"children":5438},{"style":656},[5439],{"type":612,"value":5440}," period_start ",{"type":606,"tag":644,"props":5442,"children":5443},{"style":650},[5444],{"type":612,"value":1077},{"type":606,"tag":644,"props":5446,"children":5447},{"style":656},[5448],{"type":612,"value":5449}," period_end:\n",{"type":606,"tag":644,"props":5451,"children":5452},{"class":646,"line":245},[5453,5458,5462,5467,5471,5476,5480],{"type":606,"tag":644,"props":5454,"children":5455},{"style":656},[5456],{"type":612,"value":5457},"            hours ",{"type":606,"tag":644,"props":5459,"children":5460},{"style":650},[5461],{"type":612,"value":699},{"type":606,"tag":644,"props":5463,"children":5464},{"style":656},[5465],{"type":612,"value":5466}," (period_end ",{"type":606,"tag":644,"props":5468,"children":5469},{"style":650},[5470],{"type":612,"value":804},{"type":606,"tag":644,"props":5472,"children":5473},{"style":656},[5474],{"type":612,"value":5475}," period_start).total_seconds() ",{"type":606,"tag":644,"props":5477,"children":5478},{"style":650},[5479],{"type":612,"value":1059},{"type":606,"tag":644,"props":5481,"children":5482},{"style":707},[5483],{"type":612,"value":4534},{"type":606,"tag":644,"props":5485,"children":5486},{"class":646,"line":254},[5487,5492,5496],{"type":606,"tag":644,"props":5488,"children":5489},{"style":656},[5490],{"type":612,"value":5491},"            total_hours ",{"type":606,"tag":644,"props":5493,"children":5494},{"style":650},[5495],{"type":612,"value":3698},{"type":606,"tag":644,"props":5497,"children":5498},{"style":656},[5499],{"type":612,"value":5500}," hours\n",{"type":606,"tag":644,"props":5502,"children":5503},{"class":646,"line":263},[5504],{"type":606,"tag":644,"props":5505,"children":5506},{"style":656},[5507],{"type":612,"value":5312},{"type":606,"tag":644,"props":5509,"children":5510},{"class":646,"line":272},[5511,5515,5519,5523,5527,5531,5535],{"type":606,"tag":644,"props":5512,"children":5513},{"style":656},[5514],{"type":612,"value":3711},{"type":606,"tag":644,"props":5516,"children":5517},{"style":650},[5518],{"type":612,"value":3698},{"type":606,"tag":644,"props":5520,"children":5521},{"style":656},[5522],{"type":612,"value":1259},{"type":606,"tag":644,"props":5524,"children":5525},{"style":1262},[5526],{"type":612,"value":982},{"type":606,"tag":644,"props":5528,"children":5529},{"style":650},[5530],{"type":612,"value":699},{"type":606,"tag":644,"props":5532,"children":5533},{"style":707},[5534],{"type":612,"value":720},{"type":606,"tag":644,"props":5536,"children":5537},{"style":656},[5538],{"type":612,"value":733},{"type":606,"tag":644,"props":5540,"children":5541},{"class":646,"line":281},[5542],{"type":606,"tag":644,"props":5543,"children":5544},{"style":656},[5545],{"type":612,"value":2795},{"type":606,"tag":644,"props":5547,"children":5548},{"class":646,"line":291},[5549,5553],{"type":606,"tag":644,"props":5550,"children":5551},{"style":650},[5552],{"type":612,"value":3215},{"type":606,"tag":644,"props":5554,"children":5555},{"style":656},[5556],{"type":612,"value":5557}," total_hours\n",{"type":606,"tag":644,"props":5559,"children":5560},{"class":646,"line":302},[5561],{"type":606,"tag":644,"props":5562,"children":5563},{"emptyLinePlaceholder":13},[5564],{"type":612,"value":677},{"type":606,"tag":644,"props":5566,"children":5567},{"class":646,"line":311},[5568],{"type":606,"tag":644,"props":5569,"children":5570},{"style":683},[5571],{"type":612,"value":3260},{"type":606,"tag":644,"props":5573,"children":5574},{"class":646,"line":320},[5575,5579,5583,5587,5591,5595,5599,5603,5607,5611,5616,5620,5624,5628],{"type":606,"tag":644,"props":5576,"children":5577},{"style":656},[5578],{"type":612,"value":2370},{"type":606,"tag":644,"props":5580,"children":5581},{"style":650},[5582],{"type":612,"value":699},{"type":606,"tag":644,"props":5584,"children":5585},{"style":656},[5586],{"type":612,"value":704},{"type":606,"tag":644,"props":5588,"children":5589},{"style":707},[5590],{"type":612,"value":710},{"type":606,"tag":644,"props":5592,"children":5593},{"style":656},[5594],{"type":612,"value":715},{"type":606,"tag":644,"props":5596,"children":5597},{"style":707},[5598],{"type":612,"value":762},{"type":606,"tag":644,"props":5600,"children":5601},{"style":656},[5602],{"type":612,"value":715},{"type":606,"tag":644,"props":5604,"children":5605},{"style":707},[5606],{"type":612,"value":771},{"type":606,"tag":644,"props":5608,"children":5609},{"style":656},[5610],{"type":612,"value":715},{"type":606,"tag":644,"props":5612,"children":5613},{"style":707},[5614],{"type":612,"value":5615},"14",{"type":606,"tag":644,"props":5617,"children":5618},{"style":656},[5619],{"type":612,"value":715},{"type":606,"tag":644,"props":5621,"children":5622},{"style":707},[5623],{"type":612,"value":1308},{"type":606,"tag":644,"props":5625,"children":5626},{"style":656},[5627],{"type":612,"value":3993},{"type":606,"tag":644,"props":5629,"children":5630},{"style":683},[5631],{"type":612,"value":5632},"# Friday 2:30 PM\n",{"type":606,"tag":644,"props":5634,"children":5635},{"class":646,"line":329},[5636,5640,5644,5648,5652,5656,5660,5664,5669,5673,5678,5682,5686,5691],{"type":606,"tag":644,"props":5637,"children":5638},{"style":656},[5639],{"type":612,"value":2410},{"type":606,"tag":644,"props":5641,"children":5642},{"style":650},[5643],{"type":612,"value":699},{"type":606,"tag":644,"props":5645,"children":5646},{"style":656},[5647],{"type":612,"value":704},{"type":606,"tag":644,"props":5649,"children":5650},{"style":707},[5651],{"type":612,"value":710},{"type":606,"tag":644,"props":5653,"children":5654},{"style":656},[5655],{"type":612,"value":715},{"type":606,"tag":644,"props":5657,"children":5658},{"style":707},[5659],{"type":612,"value":762},{"type":606,"tag":644,"props":5661,"children":5662},{"style":656},[5663],{"type":612,"value":715},{"type":606,"tag":644,"props":5665,"children":5666},{"style":707},[5667],{"type":612,"value":5668},"18",{"type":606,"tag":644,"props":5670,"children":5671},{"style":656},[5672],{"type":612,"value":715},{"type":606,"tag":644,"props":5674,"children":5675},{"style":707},[5676],{"type":612,"value":5677},"11",{"type":606,"tag":644,"props":5679,"children":5680},{"style":656},[5681],{"type":612,"value":715},{"type":606,"tag":644,"props":5683,"children":5684},{"style":707},[5685],{"type":612,"value":5117},{"type":606,"tag":644,"props":5687,"children":5688},{"style":656},[5689],{"type":612,"value":5690},")     ",{"type":606,"tag":644,"props":5692,"children":5693},{"style":683},[5694],{"type":612,"value":5695},"# Monday 11:00 AM\n",{"type":606,"tag":644,"props":5697,"children":5698},{"class":646,"line":338},[5699],{"type":606,"tag":644,"props":5700,"children":5701},{"emptyLinePlaceholder":13},[5702],{"type":612,"value":677},{"type":606,"tag":644,"props":5704,"children":5705},{"class":646,"line":347},[5706,5711,5715],{"type":606,"tag":644,"props":5707,"children":5708},{"style":656},[5709],{"type":612,"value":5710},"working_hours ",{"type":606,"tag":644,"props":5712,"children":5713},{"style":650},[5714],{"type":612,"value":699},{"type":606,"tag":644,"props":5716,"children":5717},{"style":656},[5718],{"type":612,"value":5719}," calculate_working_hours(project_start, project_end)\n",{"type":606,"tag":644,"props":5721,"children":5722},{"class":646,"line":356},[5723,5727,5731,5735,5740,5744,5749,5754,5758,5762],{"type":606,"tag":644,"props":5724,"children":5725},{"style":707},[5726],{"type":612,"value":817},{"type":606,"tag":644,"props":5728,"children":5729},{"style":656},[5730],{"type":612,"value":822},{"type":606,"tag":644,"props":5732,"children":5733},{"style":650},[5734],{"type":612,"value":827},{"type":606,"tag":644,"props":5736,"children":5737},{"style":830},[5738],{"type":612,"value":5739},"\"Total working hours: ",{"type":606,"tag":644,"props":5741,"children":5742},{"style":707},[5743],{"type":612,"value":838},{"type":606,"tag":644,"props":5745,"children":5746},{"style":656},[5747],{"type":612,"value":5748},"working_hours",{"type":606,"tag":644,"props":5750,"children":5751},{"style":650},[5752],{"type":612,"value":5753},":.2f",{"type":606,"tag":644,"props":5755,"children":5756},{"style":707},[5757],{"type":612,"value":848},{"type":606,"tag":644,"props":5759,"children":5760},{"style":830},[5761],{"type":612,"value":853},{"type":606,"tag":644,"props":5763,"children":5764},{"style":656},[5765],{"type":612,"value":733},{"type":606,"tag":1119,"props":5767,"children":5769},{"id":5768},"age-calculations",[5770],{"type":612,"value":5771},"Age Calculations",{"type":606,"tag":630,"props":5773,"children":5774},{},[5775],{"type":606,"tag":634,"props":5776,"children":5778},{"className":636,"code":5777,"language":638,"meta":8,"style":8},"from datetime import datetime, date\n\ndef calculate_precise_age(birth_date, reference_date=None):\n    \"\"\"Calculate precise age in years, months, and days\"\"\"\n    if reference_date is None:\n        reference_date = date.today()\n    \n    years = reference_date.year - birth_date.year\n    months = reference_date.month - birth_date.month\n    days = reference_date.day - birth_date.day\n    \n    # Adjust for negative days\n    if days \u003C 0:\n        months -= 1\n        # Get days in previous month\n        if reference_date.month == 1:\n            prev_month = date(reference_date.year - 1, 12, 1)\n        else:\n            prev_month = date(reference_date.year, reference_date.month - 1, 1)\n        \n        next_month = date(prev_month.year, prev_month.month + 1, 1)\n        days_in_prev_month = (next_month - prev_month).days\n        days += days_in_prev_month\n    \n    # Adjust for negative months\n    if months \u003C 0:\n        years -= 1\n        months += 12\n    \n    return years, months, days\n\n# Example usage\nbirth = date(1990, 8, 25)\nyears, months, days = calculate_precise_age(birth)\nprint(f\"Age: {years} years, {months} months, {days} days\")\n\n# Calculate age at specific date\nspecific_date = date(2024, 12, 31)\ny, m, d = calculate_precise_age(birth, specific_date)\nprint(f\"Age on {specific_date}: {y} years, {m} months, {d} days\")\n",[5779],{"type":606,"tag":621,"props":5780,"children":5781},{"__ignoreMap":8},[5782,5801,5808,5839,5847,5873,5890,5897,5923,5949,5974,5981,5989,6012,6029,6037,6060,6106,6118,6154,6161,6198,6224,6241,6248,6256,6280,6296,6312,6319,6331,6338,6345,6386,6403,6479,6486,6494,6535,6552],{"type":606,"tag":644,"props":5783,"children":5784},{"class":646,"line":12},[5785,5789,5793,5797],{"type":606,"tag":644,"props":5786,"children":5787},{"style":650},[5788],{"type":612,"value":653},{"type":606,"tag":644,"props":5790,"children":5791},{"style":656},[5792],{"type":612,"value":659},{"type":606,"tag":644,"props":5794,"children":5795},{"style":650},[5796],{"type":612,"value":664},{"type":606,"tag":644,"props":5798,"children":5799},{"style":656},[5800],{"type":612,"value":2156},{"type":606,"tag":644,"props":5802,"children":5803},{"class":646,"line":27},[5804],{"type":606,"tag":644,"props":5805,"children":5806},{"emptyLinePlaceholder":13},[5807],{"type":612,"value":677},{"type":606,"tag":644,"props":5809,"children":5810},{"class":646,"line":36},[5811,5815,5820,5825,5829,5834],{"type":606,"tag":644,"props":5812,"children":5813},{"style":650},[5814],{"type":612,"value":2634},{"type":606,"tag":644,"props":5816,"children":5817},{"style":2637},[5818],{"type":612,"value":5819}," calculate_precise_age",{"type":606,"tag":644,"props":5821,"children":5822},{"style":656},[5823],{"type":612,"value":5824},"(birth_date, reference_date",{"type":606,"tag":644,"props":5826,"children":5827},{"style":650},[5828],{"type":612,"value":699},{"type":606,"tag":644,"props":5830,"children":5831},{"style":707},[5832],{"type":612,"value":5833},"None",{"type":606,"tag":644,"props":5835,"children":5836},{"style":656},[5837],{"type":612,"value":5838},"):\n",{"type":606,"tag":644,"props":5840,"children":5841},{"class":646,"line":45},[5842],{"type":606,"tag":644,"props":5843,"children":5844},{"style":830},[5845],{"type":612,"value":5846},"    \"\"\"Calculate precise age in years, months, and days\"\"\"\n",{"type":606,"tag":644,"props":5848,"children":5849},{"class":646,"line":54},[5850,5854,5859,5864,5869],{"type":606,"tag":644,"props":5851,"children":5852},{"style":650},[5853],{"type":612,"value":2820},{"type":606,"tag":644,"props":5855,"children":5856},{"style":656},[5857],{"type":612,"value":5858}," reference_date ",{"type":606,"tag":644,"props":5860,"children":5861},{"style":650},[5862],{"type":612,"value":5863},"is",{"type":606,"tag":644,"props":5865,"children":5866},{"style":707},[5867],{"type":612,"value":5868}," None",{"type":606,"tag":644,"props":5870,"children":5871},{"style":656},[5872],{"type":612,"value":4407},{"type":606,"tag":644,"props":5874,"children":5875},{"class":646,"line":63},[5876,5881,5885],{"type":606,"tag":644,"props":5877,"children":5878},{"style":656},[5879],{"type":612,"value":5880},"        reference_date ",{"type":606,"tag":644,"props":5882,"children":5883},{"style":650},[5884],{"type":612,"value":699},{"type":606,"tag":644,"props":5886,"children":5887},{"style":656},[5888],{"type":612,"value":5889}," date.today()\n",{"type":606,"tag":644,"props":5891,"children":5892},{"class":646,"line":72},[5893],{"type":606,"tag":644,"props":5894,"children":5895},{"style":656},[5896],{"type":612,"value":2795},{"type":606,"tag":644,"props":5898,"children":5899},{"class":646,"line":81},[5900,5905,5909,5914,5918],{"type":606,"tag":644,"props":5901,"children":5902},{"style":656},[5903],{"type":612,"value":5904},"    years ",{"type":606,"tag":644,"props":5906,"children":5907},{"style":650},[5908],{"type":612,"value":699},{"type":606,"tag":644,"props":5910,"children":5911},{"style":656},[5912],{"type":612,"value":5913}," reference_date.year ",{"type":606,"tag":644,"props":5915,"children":5916},{"style":650},[5917],{"type":612,"value":804},{"type":606,"tag":644,"props":5919,"children":5920},{"style":656},[5921],{"type":612,"value":5922}," birth_date.year\n",{"type":606,"tag":644,"props":5924,"children":5925},{"class":646,"line":860},[5926,5931,5935,5940,5944],{"type":606,"tag":644,"props":5927,"children":5928},{"style":656},[5929],{"type":612,"value":5930},"    months ",{"type":606,"tag":644,"props":5932,"children":5933},{"style":650},[5934],{"type":612,"value":699},{"type":606,"tag":644,"props":5936,"children":5937},{"style":656},[5938],{"type":612,"value":5939}," reference_date.month ",{"type":606,"tag":644,"props":5941,"children":5942},{"style":650},[5943],{"type":612,"value":804},{"type":606,"tag":644,"props":5945,"children":5946},{"style":656},[5947],{"type":612,"value":5948}," birth_date.month\n",{"type":606,"tag":644,"props":5950,"children":5951},{"class":646,"line":99},[5952,5956,5960,5965,5969],{"type":606,"tag":644,"props":5953,"children":5954},{"style":656},[5955],{"type":612,"value":2683},{"type":606,"tag":644,"props":5957,"children":5958},{"style":650},[5959],{"type":612,"value":699},{"type":606,"tag":644,"props":5961,"children":5962},{"style":656},[5963],{"type":612,"value":5964}," reference_date.day ",{"type":606,"tag":644,"props":5966,"children":5967},{"style":650},[5968],{"type":612,"value":804},{"type":606,"tag":644,"props":5970,"children":5971},{"style":656},[5972],{"type":612,"value":5973}," birth_date.day\n",{"type":606,"tag":644,"props":5975,"children":5976},{"class":646,"line":108},[5977],{"type":606,"tag":644,"props":5978,"children":5979},{"style":656},[5980],{"type":612,"value":2795},{"type":606,"tag":644,"props":5982,"children":5983},{"class":646,"line":117},[5984],{"type":606,"tag":644,"props":5985,"children":5986},{"style":683},[5987],{"type":612,"value":5988},"    # Adjust for negative days\n",{"type":606,"tag":644,"props":5990,"children":5991},{"class":646,"line":126},[5992,5996,6000,6004,6008],{"type":606,"tag":644,"props":5993,"children":5994},{"style":650},[5995],{"type":612,"value":2820},{"type":606,"tag":644,"props":5997,"children":5998},{"style":656},[5999],{"type":612,"value":2877},{"type":606,"tag":644,"props":6001,"children":6002},{"style":650},[6003],{"type":612,"value":1077},{"type":606,"tag":644,"props":6005,"children":6006},{"style":707},[6007],{"type":612,"value":4598},{"type":606,"tag":644,"props":6009,"children":6010},{"style":656},[6011],{"type":612,"value":4407},{"type":606,"tag":644,"props":6013,"children":6014},{"class":646,"line":135},[6015,6020,6025],{"type":606,"tag":644,"props":6016,"children":6017},{"style":656},[6018],{"type":612,"value":6019},"        months ",{"type":606,"tag":644,"props":6021,"children":6022},{"style":650},[6023],{"type":612,"value":6024},"-=",{"type":606,"tag":644,"props":6026,"children":6027},{"style":707},[6028],{"type":612,"value":3703},{"type":606,"tag":644,"props":6030,"children":6031},{"class":646,"line":144},[6032],{"type":606,"tag":644,"props":6033,"children":6034},{"style":683},[6035],{"type":612,"value":6036},"        # Get days in previous month\n",{"type":606,"tag":644,"props":6038,"children":6039},{"class":646,"line":153},[6040,6044,6048,6052,6056],{"type":606,"tag":644,"props":6041,"children":6042},{"style":650},[6043],{"type":612,"value":3661},{"type":606,"tag":644,"props":6045,"children":6046},{"style":656},[6047],{"type":612,"value":5939},{"type":606,"tag":644,"props":6049,"children":6050},{"style":650},[6051],{"type":612,"value":1070},{"type":606,"tag":644,"props":6053,"children":6054},{"style":707},[6055],{"type":612,"value":2887},{"type":606,"tag":644,"props":6057,"children":6058},{"style":656},[6059],{"type":612,"value":4407},{"type":606,"tag":644,"props":6061,"children":6062},{"class":646,"line":163},[6063,6068,6072,6077,6081,6085,6089,6094,6098,6102],{"type":606,"tag":644,"props":6064,"children":6065},{"style":656},[6066],{"type":612,"value":6067},"            prev_month ",{"type":606,"tag":644,"props":6069,"children":6070},{"style":650},[6071],{"type":612,"value":699},{"type":606,"tag":644,"props":6073,"children":6074},{"style":656},[6075],{"type":612,"value":6076}," date(reference_date.year ",{"type":606,"tag":644,"props":6078,"children":6079},{"style":650},[6080],{"type":612,"value":804},{"type":606,"tag":644,"props":6082,"children":6083},{"style":707},[6084],{"type":612,"value":2887},{"type":606,"tag":644,"props":6086,"children":6087},{"style":656},[6088],{"type":612,"value":715},{"type":606,"tag":644,"props":6090,"children":6091},{"style":707},[6092],{"type":612,"value":6093},"12",{"type":606,"tag":644,"props":6095,"children":6096},{"style":656},[6097],{"type":612,"value":715},{"type":606,"tag":644,"props":6099,"children":6100},{"style":707},[6101],{"type":612,"value":720},{"type":606,"tag":644,"props":6103,"children":6104},{"style":656},[6105],{"type":612,"value":733},{"type":606,"tag":644,"props":6107,"children":6108},{"class":646,"line":172},[6109,6114],{"type":606,"tag":644,"props":6110,"children":6111},{"style":650},[6112],{"type":612,"value":6113},"        else",{"type":606,"tag":644,"props":6115,"children":6116},{"style":656},[6117],{"type":612,"value":4407},{"type":606,"tag":644,"props":6119,"children":6120},{"class":646,"line":181},[6121,6125,6129,6134,6138,6142,6146,6150],{"type":606,"tag":644,"props":6122,"children":6123},{"style":656},[6124],{"type":612,"value":6067},{"type":606,"tag":644,"props":6126,"children":6127},{"style":650},[6128],{"type":612,"value":699},{"type":606,"tag":644,"props":6130,"children":6131},{"style":656},[6132],{"type":612,"value":6133}," date(reference_date.year, reference_date.month ",{"type":606,"tag":644,"props":6135,"children":6136},{"style":650},[6137],{"type":612,"value":804},{"type":606,"tag":644,"props":6139,"children":6140},{"style":707},[6141],{"type":612,"value":2887},{"type":606,"tag":644,"props":6143,"children":6144},{"style":656},[6145],{"type":612,"value":715},{"type":606,"tag":644,"props":6147,"children":6148},{"style":707},[6149],{"type":612,"value":720},{"type":606,"tag":644,"props":6151,"children":6152},{"style":656},[6153],{"type":612,"value":733},{"type":606,"tag":644,"props":6155,"children":6156},{"class":646,"line":190},[6157],{"type":606,"tag":644,"props":6158,"children":6159},{"style":656},[6160],{"type":612,"value":5312},{"type":606,"tag":644,"props":6162,"children":6163},{"class":646,"line":199},[6164,6169,6173,6178,6182,6186,6190,6194],{"type":606,"tag":644,"props":6165,"children":6166},{"style":656},[6167],{"type":612,"value":6168},"        next_month ",{"type":606,"tag":644,"props":6170,"children":6171},{"style":650},[6172],{"type":612,"value":699},{"type":606,"tag":644,"props":6174,"children":6175},{"style":656},[6176],{"type":612,"value":6177}," date(prev_month.year, prev_month.month ",{"type":606,"tag":644,"props":6179,"children":6180},{"style":650},[6181],{"type":612,"value":1039},{"type":606,"tag":644,"props":6183,"children":6184},{"style":707},[6185],{"type":612,"value":2887},{"type":606,"tag":644,"props":6187,"children":6188},{"style":656},[6189],{"type":612,"value":715},{"type":606,"tag":644,"props":6191,"children":6192},{"style":707},[6193],{"type":612,"value":720},{"type":606,"tag":644,"props":6195,"children":6196},{"style":656},[6197],{"type":612,"value":733},{"type":606,"tag":644,"props":6199,"children":6200},{"class":646,"line":208},[6201,6206,6210,6215,6219],{"type":606,"tag":644,"props":6202,"children":6203},{"style":656},[6204],{"type":612,"value":6205},"        days_in_prev_month ",{"type":606,"tag":644,"props":6207,"children":6208},{"style":650},[6209],{"type":612,"value":699},{"type":606,"tag":644,"props":6211,"children":6212},{"style":656},[6213],{"type":612,"value":6214}," (next_month ",{"type":606,"tag":644,"props":6216,"children":6217},{"style":650},[6218],{"type":612,"value":804},{"type":606,"tag":644,"props":6220,"children":6221},{"style":656},[6222],{"type":612,"value":6223}," prev_month).days\n",{"type":606,"tag":644,"props":6225,"children":6226},{"class":646,"line":217},[6227,6232,6236],{"type":606,"tag":644,"props":6228,"children":6229},{"style":656},[6230],{"type":612,"value":6231},"        days ",{"type":606,"tag":644,"props":6233,"children":6234},{"style":650},[6235],{"type":612,"value":3698},{"type":606,"tag":644,"props":6237,"children":6238},{"style":656},[6239],{"type":612,"value":6240}," days_in_prev_month\n",{"type":606,"tag":644,"props":6242,"children":6243},{"class":646,"line":227},[6244],{"type":606,"tag":644,"props":6245,"children":6246},{"style":656},[6247],{"type":612,"value":2795},{"type":606,"tag":644,"props":6249,"children":6250},{"class":646,"line":236},[6251],{"type":606,"tag":644,"props":6252,"children":6253},{"style":683},[6254],{"type":612,"value":6255},"    # Adjust for negative months\n",{"type":606,"tag":644,"props":6257,"children":6258},{"class":646,"line":245},[6259,6263,6268,6272,6276],{"type":606,"tag":644,"props":6260,"children":6261},{"style":650},[6262],{"type":612,"value":2820},{"type":606,"tag":644,"props":6264,"children":6265},{"style":656},[6266],{"type":612,"value":6267}," months ",{"type":606,"tag":644,"props":6269,"children":6270},{"style":650},[6271],{"type":612,"value":1077},{"type":606,"tag":644,"props":6273,"children":6274},{"style":707},[6275],{"type":612,"value":4598},{"type":606,"tag":644,"props":6277,"children":6278},{"style":656},[6279],{"type":612,"value":4407},{"type":606,"tag":644,"props":6281,"children":6282},{"class":646,"line":254},[6283,6288,6292],{"type":606,"tag":644,"props":6284,"children":6285},{"style":656},[6286],{"type":612,"value":6287},"        years ",{"type":606,"tag":644,"props":6289,"children":6290},{"style":650},[6291],{"type":612,"value":6024},{"type":606,"tag":644,"props":6293,"children":6294},{"style":707},[6295],{"type":612,"value":3703},{"type":606,"tag":644,"props":6297,"children":6298},{"class":646,"line":263},[6299,6303,6307],{"type":606,"tag":644,"props":6300,"children":6301},{"style":656},[6302],{"type":612,"value":6019},{"type":606,"tag":644,"props":6304,"children":6305},{"style":650},[6306],{"type":612,"value":3698},{"type":606,"tag":644,"props":6308,"children":6309},{"style":707},[6310],{"type":612,"value":6311}," 12\n",{"type":606,"tag":644,"props":6313,"children":6314},{"class":646,"line":272},[6315],{"type":606,"tag":644,"props":6316,"children":6317},{"style":656},[6318],{"type":612,"value":2795},{"type":606,"tag":644,"props":6320,"children":6321},{"class":646,"line":281},[6322,6326],{"type":606,"tag":644,"props":6323,"children":6324},{"style":650},[6325],{"type":612,"value":3215},{"type":606,"tag":644,"props":6327,"children":6328},{"style":656},[6329],{"type":612,"value":6330}," years, months, days\n",{"type":606,"tag":644,"props":6332,"children":6333},{"class":646,"line":291},[6334],{"type":606,"tag":644,"props":6335,"children":6336},{"emptyLinePlaceholder":13},[6337],{"type":612,"value":677},{"type":606,"tag":644,"props":6339,"children":6340},{"class":646,"line":302},[6341],{"type":606,"tag":644,"props":6342,"children":6343},{"style":683},[6344],{"type":612,"value":3260},{"type":606,"tag":644,"props":6346,"children":6347},{"class":646,"line":311},[6348,6353,6357,6362,6366,6370,6374,6378,6382],{"type":606,"tag":644,"props":6349,"children":6350},{"style":656},[6351],{"type":612,"value":6352},"birth ",{"type":606,"tag":644,"props":6354,"children":6355},{"style":650},[6356],{"type":612,"value":699},{"type":606,"tag":644,"props":6358,"children":6359},{"style":656},[6360],{"type":612,"value":6361}," date(",{"type":606,"tag":644,"props":6363,"children":6364},{"style":707},[6365],{"type":612,"value":2192},{"type":606,"tag":644,"props":6367,"children":6368},{"style":656},[6369],{"type":612,"value":715},{"type":606,"tag":644,"props":6371,"children":6372},{"style":707},[6373],{"type":612,"value":1774},{"type":606,"tag":644,"props":6375,"children":6376},{"style":656},[6377],{"type":612,"value":715},{"type":606,"tag":644,"props":6379,"children":6380},{"style":707},[6381],{"type":612,"value":4035},{"type":606,"tag":644,"props":6383,"children":6384},{"style":656},[6385],{"type":612,"value":733},{"type":606,"tag":644,"props":6387,"children":6388},{"class":646,"line":320},[6389,6394,6398],{"type":606,"tag":644,"props":6390,"children":6391},{"style":656},[6392],{"type":612,"value":6393},"years, months, days ",{"type":606,"tag":644,"props":6395,"children":6396},{"style":650},[6397],{"type":612,"value":699},{"type":606,"tag":644,"props":6399,"children":6400},{"style":656},[6401],{"type":612,"value":6402}," calculate_precise_age(birth)\n",{"type":606,"tag":644,"props":6404,"children":6405},{"class":646,"line":329},[6406,6410,6414,6418,6423,6427,6432,6436,6441,6445,6450,6454,6459,6463,6467,6471,6475],{"type":606,"tag":644,"props":6407,"children":6408},{"style":707},[6409],{"type":612,"value":817},{"type":606,"tag":644,"props":6411,"children":6412},{"style":656},[6413],{"type":612,"value":822},{"type":606,"tag":644,"props":6415,"children":6416},{"style":650},[6417],{"type":612,"value":827},{"type":606,"tag":644,"props":6419,"children":6420},{"style":830},[6421],{"type":612,"value":6422},"\"Age: ",{"type":606,"tag":644,"props":6424,"children":6425},{"style":707},[6426],{"type":612,"value":838},{"type":606,"tag":644,"props":6428,"children":6429},{"style":656},[6430],{"type":612,"value":6431},"years",{"type":606,"tag":644,"props":6433,"children":6434},{"style":707},[6435],{"type":612,"value":848},{"type":606,"tag":644,"props":6437,"children":6438},{"style":830},[6439],{"type":612,"value":6440}," years, ",{"type":606,"tag":644,"props":6442,"children":6443},{"style":707},[6444],{"type":612,"value":838},{"type":606,"tag":644,"props":6446,"children":6447},{"style":656},[6448],{"type":612,"value":6449},"months",{"type":606,"tag":644,"props":6451,"children":6452},{"style":707},[6453],{"type":612,"value":848},{"type":606,"tag":644,"props":6455,"children":6456},{"style":830},[6457],{"type":612,"value":6458}," months, ",{"type":606,"tag":644,"props":6460,"children":6461},{"style":707},[6462],{"type":612,"value":838},{"type":606,"tag":644,"props":6464,"children":6465},{"style":656},[6466],{"type":612,"value":982},{"type":606,"tag":644,"props":6468,"children":6469},{"style":707},[6470],{"type":612,"value":848},{"type":606,"tag":644,"props":6472,"children":6473},{"style":830},[6474],{"type":612,"value":2514},{"type":606,"tag":644,"props":6476,"children":6477},{"style":656},[6478],{"type":612,"value":733},{"type":606,"tag":644,"props":6480,"children":6481},{"class":646,"line":338},[6482],{"type":606,"tag":644,"props":6483,"children":6484},{"emptyLinePlaceholder":13},[6485],{"type":612,"value":677},{"type":606,"tag":644,"props":6487,"children":6488},{"class":646,"line":347},[6489],{"type":606,"tag":644,"props":6490,"children":6491},{"style":683},[6492],{"type":612,"value":6493},"# Calculate age at specific date\n",{"type":606,"tag":644,"props":6495,"children":6496},{"class":646,"line":356},[6497,6502,6506,6510,6514,6518,6522,6526,6531],{"type":606,"tag":644,"props":6498,"children":6499},{"style":656},[6500],{"type":612,"value":6501},"specific_date ",{"type":606,"tag":644,"props":6503,"children":6504},{"style":650},[6505],{"type":612,"value":699},{"type":606,"tag":644,"props":6507,"children":6508},{"style":656},[6509],{"type":612,"value":6361},{"type":606,"tag":644,"props":6511,"children":6512},{"style":707},[6513],{"type":612,"value":710},{"type":606,"tag":644,"props":6515,"children":6516},{"style":656},[6517],{"type":612,"value":715},{"type":606,"tag":644,"props":6519,"children":6520},{"style":707},[6521],{"type":612,"value":6093},{"type":606,"tag":644,"props":6523,"children":6524},{"style":656},[6525],{"type":612,"value":715},{"type":606,"tag":644,"props":6527,"children":6528},{"style":707},[6529],{"type":612,"value":6530},"31",{"type":606,"tag":644,"props":6532,"children":6533},{"style":656},[6534],{"type":612,"value":733},{"type":606,"tag":644,"props":6536,"children":6537},{"class":646,"line":367},[6538,6543,6547],{"type":606,"tag":644,"props":6539,"children":6540},{"style":656},[6541],{"type":612,"value":6542},"y, m, d ",{"type":606,"tag":644,"props":6544,"children":6545},{"style":650},[6546],{"type":612,"value":699},{"type":606,"tag":644,"props":6548,"children":6549},{"style":656},[6550],{"type":612,"value":6551}," calculate_precise_age(birth, specific_date)\n",{"type":606,"tag":644,"props":6553,"children":6554},{"class":646,"line":376},[6555,6559,6563,6567,6572,6576,6581,6585,6589,6593,6598,6602,6606,6610,6615,6619,6623,6627,6632,6636,6640],{"type":606,"tag":644,"props":6556,"children":6557},{"style":707},[6558],{"type":612,"value":817},{"type":606,"tag":644,"props":6560,"children":6561},{"style":656},[6562],{"type":612,"value":822},{"type":606,"tag":644,"props":6564,"children":6565},{"style":650},[6566],{"type":612,"value":827},{"type":606,"tag":644,"props":6568,"children":6569},{"style":830},[6570],{"type":612,"value":6571},"\"Age on ",{"type":606,"tag":644,"props":6573,"children":6574},{"style":707},[6575],{"type":612,"value":838},{"type":606,"tag":644,"props":6577,"children":6578},{"style":656},[6579],{"type":612,"value":6580},"specific_date",{"type":606,"tag":644,"props":6582,"children":6583},{"style":707},[6584],{"type":612,"value":848},{"type":606,"tag":644,"props":6586,"children":6587},{"style":830},[6588],{"type":612,"value":4119},{"type":606,"tag":644,"props":6590,"children":6591},{"style":707},[6592],{"type":612,"value":838},{"type":606,"tag":644,"props":6594,"children":6595},{"style":656},[6596],{"type":612,"value":6597},"y",{"type":606,"tag":644,"props":6599,"children":6600},{"style":707},[6601],{"type":612,"value":848},{"type":606,"tag":644,"props":6603,"children":6604},{"style":830},[6605],{"type":612,"value":6440},{"type":606,"tag":644,"props":6607,"children":6608},{"style":707},[6609],{"type":612,"value":838},{"type":606,"tag":644,"props":6611,"children":6612},{"style":656},[6613],{"type":612,"value":6614},"m",{"type":606,"tag":644,"props":6616,"children":6617},{"style":707},[6618],{"type":612,"value":848},{"type":606,"tag":644,"props":6620,"children":6621},{"style":830},[6622],{"type":612,"value":6458},{"type":606,"tag":644,"props":6624,"children":6625},{"style":707},[6626],{"type":612,"value":838},{"type":606,"tag":644,"props":6628,"children":6629},{"style":656},[6630],{"type":612,"value":6631},"d",{"type":606,"tag":644,"props":6633,"children":6634},{"style":707},[6635],{"type":612,"value":848},{"type":606,"tag":644,"props":6637,"children":6638},{"style":830},[6639],{"type":612,"value":2514},{"type":606,"tag":644,"props":6641,"children":6642},{"style":656},[6643],{"type":612,"value":733},{"type":606,"tag":942,"props":6645,"children":6647},{"id":6646},"timedelta-reference",[6648],{"type":612,"value":6649},"📊 Timedelta Reference",{"type":606,"tag":6651,"props":6652,"children":6653},"table",{},[6654,6678],{"type":606,"tag":6655,"props":6656,"children":6657},"thead",{},[6658],{"type":606,"tag":6659,"props":6660,"children":6661},"tr",{},[6662,6668,6673],{"type":606,"tag":6663,"props":6664,"children":6665},"th",{},[6666],{"type":612,"value":6667},"Operation",{"type":606,"tag":6663,"props":6669,"children":6670},{},[6671],{"type":612,"value":6672},"Example",{"type":606,"tag":6663,"props":6674,"children":6675},{},[6676],{"type":612,"value":6677},"Result",{"type":606,"tag":6679,"props":6680,"children":6681},"tbody",{},[6682,6705,6727,6749,6770,6792,6814],{"type":606,"tag":6659,"props":6683,"children":6684},{},[6685,6691,6700],{"type":606,"tag":6686,"props":6687,"children":6688},"td",{},[6689],{"type":612,"value":6690},"Create",{"type":606,"tag":6686,"props":6692,"children":6693},{},[6694],{"type":606,"tag":621,"props":6695,"children":6697},{"className":6696},[],[6698],{"type":612,"value":6699},"timedelta(days=7)",{"type":606,"tag":6686,"props":6701,"children":6702},{},[6703],{"type":612,"value":6704},"7 days duration",{"type":606,"tag":6659,"props":6706,"children":6707},{},[6708,6713,6722],{"type":606,"tag":6686,"props":6709,"children":6710},{},[6711],{"type":612,"value":6712},"Add to date",{"type":606,"tag":6686,"props":6714,"children":6715},{},[6716],{"type":606,"tag":621,"props":6717,"children":6719},{"className":6718},[],[6720],{"type":612,"value":6721},"date + timedelta(days=1)",{"type":606,"tag":6686,"props":6723,"children":6724},{},[6725],{"type":612,"value":6726},"Next day",{"type":606,"tag":6659,"props":6728,"children":6729},{},[6730,6735,6744],{"type":606,"tag":6686,"props":6731,"children":6732},{},[6733],{"type":612,"value":6734},"Subtract from date",{"type":606,"tag":6686,"props":6736,"children":6737},{},[6738],{"type":606,"tag":621,"props":6739,"children":6741},{"className":6740},[],[6742],{"type":612,"value":6743},"date - timedelta(hours=2)",{"type":606,"tag":6686,"props":6745,"children":6746},{},[6747],{"type":612,"value":6748},"2 hours earlier",{"type":606,"tag":6659,"props":6750,"children":6751},{},[6752,6757,6765],{"type":606,"tag":6686,"props":6753,"children":6754},{},[6755],{"type":612,"value":6756},"Date difference",{"type":606,"tag":6686,"props":6758,"children":6759},{},[6760],{"type":606,"tag":621,"props":6761,"children":6763},{"className":6762},[],[6764],{"type":612,"value":1106},{"type":606,"tag":6686,"props":6766,"children":6767},{},[6768],{"type":612,"value":6769},"Timedelta object",{"type":606,"tag":6659,"props":6771,"children":6772},{},[6773,6778,6787],{"type":606,"tag":6686,"props":6774,"children":6775},{},[6776],{"type":612,"value":6777},"Total seconds",{"type":606,"tag":6686,"props":6779,"children":6780},{},[6781],{"type":606,"tag":621,"props":6782,"children":6784},{"className":6783},[],[6785],{"type":612,"value":6786},"td.total_seconds()",{"type":606,"tag":6686,"props":6788,"children":6789},{},[6790],{"type":612,"value":6791},"Duration in seconds",{"type":606,"tag":6659,"props":6793,"children":6794},{},[6795,6800,6809],{"type":606,"tag":6686,"props":6796,"children":6797},{},[6798],{"type":612,"value":6799},"Multiply",{"type":606,"tag":6686,"props":6801,"children":6802},{},[6803],{"type":606,"tag":621,"props":6804,"children":6806},{"className":6805},[],[6807],{"type":612,"value":6808},"timedelta(hours=1) * 3",{"type":606,"tag":6686,"props":6810,"children":6811},{},[6812],{"type":612,"value":6813},"3 hours",{"type":606,"tag":6659,"props":6815,"children":6816},{},[6817,6822,6831],{"type":606,"tag":6686,"props":6818,"children":6819},{},[6820],{"type":612,"value":6821},"Compare",{"type":606,"tag":6686,"props":6823,"children":6824},{},[6825],{"type":606,"tag":621,"props":6826,"children":6828},{"className":6827},[],[6829],{"type":612,"value":6830},"td1 > td2",{"type":606,"tag":6686,"props":6832,"children":6833},{},[6834],{"type":612,"value":6835},"Boolean comparison",{"type":606,"tag":942,"props":6837,"children":6839},{"id":6838},"key-takeaways",[6840],{"type":612,"value":6841},"🎯 Key Takeaways",{"type":606,"tag":954,"props":6843,"children":6847},{"emoji":6844,"title":6845,"type":6846},"📚","Date Difference Essentials","success",[6848,6856,6909,6917,6940,6948,6978],{"type":606,"tag":615,"props":6849,"children":6850},{},[6851],{"type":606,"tag":964,"props":6852,"children":6853},{},[6854],{"type":612,"value":6855},"Basic Operations:",{"type":606,"tag":970,"props":6857,"children":6858},{},[6859,6871,6884],{"type":606,"tag":974,"props":6860,"children":6861},{},[6862,6864,6869],{"type":612,"value":6863},"Subtract dates: ",{"type":606,"tag":621,"props":6865,"children":6867},{"className":6866},[],[6868],{"type":612,"value":1106},{"type":612,"value":6870}," → timedelta",{"type":606,"tag":974,"props":6872,"children":6873},{},[6874,6876,6882],{"type":612,"value":6875},"Add duration: ",{"type":606,"tag":621,"props":6877,"children":6879},{"className":6878},[],[6880],{"type":612,"value":6881},"date + timedelta",{"type":612,"value":6883}," → new date",{"type":606,"tag":974,"props":6885,"children":6886},{},[6887,6889,6895,6896,6902,6903],{"type":612,"value":6888},"Access components: ",{"type":606,"tag":621,"props":6890,"children":6892},{"className":6891},[],[6893],{"type":612,"value":6894},".days",{"type":612,"value":715},{"type":606,"tag":621,"props":6897,"children":6899},{"className":6898},[],[6900],{"type":612,"value":6901},".seconds",{"type":612,"value":715},{"type":606,"tag":621,"props":6904,"children":6906},{"className":6905},[],[6907],{"type":612,"value":6908},".total_seconds()",{"type":606,"tag":615,"props":6910,"children":6911},{},[6912],{"type":606,"tag":964,"props":6913,"children":6914},{},[6915],{"type":612,"value":6916},"Common Calculations:",{"type":606,"tag":970,"props":6918,"children":6919},{},[6920,6925,6930,6935],{"type":606,"tag":974,"props":6921,"children":6922},{},[6923],{"type":612,"value":6924},"Age calculation",{"type":606,"tag":974,"props":6926,"children":6927},{},[6928],{"type":612,"value":6929},"Project duration",{"type":606,"tag":974,"props":6931,"children":6932},{},[6933],{"type":612,"value":6934},"Time until events",{"type":606,"tag":974,"props":6936,"children":6937},{},[6938],{"type":612,"value":6939},"Business days counting",{"type":606,"tag":615,"props":6941,"children":6942},{},[6943],{"type":606,"tag":964,"props":6944,"children":6945},{},[6946],{"type":612,"value":6947},"Best Practices:",{"type":606,"tag":970,"props":6949,"children":6950},{},[6951,6963,6968,6973],{"type":606,"tag":974,"props":6952,"children":6953},{},[6954,6956,6961],{"type":612,"value":6955},"Use ",{"type":606,"tag":621,"props":6957,"children":6959},{"className":6958},[],[6960],{"type":612,"value":6908},{"type":612,"value":6962}," for precise calculations",{"type":606,"tag":974,"props":6964,"children":6965},{},[6966],{"type":612,"value":6967},"Consider business days for work schedules",{"type":606,"tag":974,"props":6969,"children":6970},{},[6971],{"type":612,"value":6972},"Handle time zones consistently",{"type":606,"tag":974,"props":6974,"children":6975},{},[6976],{"type":612,"value":6977},"Format durations for user display",{"type":606,"tag":615,"props":6979,"children":6980},{},[6981,6986],{"type":606,"tag":964,"props":6982,"children":6983},{},[6984],{"type":612,"value":6985},"Remember:",{"type":612,"value":6987}," Timedelta makes date arithmetic intuitive and powerful!",{"type":606,"tag":942,"props":6989,"children":6991},{"id":6990},"whats-next",[6992],{"type":612,"value":6993},"🚀 What's Next?",{"type":606,"tag":615,"props":6995,"children":6996},{},[6997],{"type":612,"value":6998},"Now that you can calculate time differences, learn how to parse date strings from text input.",{"type":606,"tag":615,"props":7000,"children":7001},{},[7002,7007,7008],{"type":606,"tag":964,"props":7003,"children":7004},{},[7005],{"type":612,"value":7006},"Continue to",{"type":612,"value":4119},{"type":606,"tag":7009,"props":7010,"children":7011},"a",{"href":325},[7012],{"type":612,"value":326},{"type":606,"tag":7014,"props":7015,"children":7016},"style",{},[7017],{"type":612,"value":7018},"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":7020},[7021,7026,7031,7035,7036,7037],{"id":944,"depth":27,"text":947,"children":7022},[7023,7024,7025],{"id":1121,"depth":36,"text":1124},{"id":1552,"depth":36,"text":1555},{"id":2123,"depth":36,"text":2126},{"id":2576,"depth":27,"text":2579,"children":7027},[7028,7029,7030],{"id":2587,"depth":36,"text":2590},{"id":3519,"depth":36,"text":3522},{"id":4233,"depth":36,"text":4236},{"id":5018,"depth":27,"text":5021,"children":7032},[7033,7034],{"id":5029,"depth":36,"text":5032},{"id":5768,"depth":36,"text":5771},{"id":6646,"depth":27,"text":6649},{"id":6838,"depth":27,"text":6841},{"id":6990,"depth":27,"text":6993},1782373758469]