[{"data":1,"prerenderedAt":5924},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/parse-date-strings":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",[324],{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"body":602,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},{"type":603,"children":604,"toc":5906},"root",[605,614,629,989,996,1008,1154,1161,1571,1577,1974,1980,2392,2398,2403,2409,3093,3099,3910,3916,4872,4878,4884,5099,5105,5704,5710,5875,5881,5886,5900],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"parsing-date-strings",[611],{"type":612,"value":613},"text","📝 Parsing Date Strings",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618,620,627],{"type":612,"value":619},"Converting date strings into Python datetime objects is crucial for processing user input, reading data files, and handling dates from various sources. Python's ",{"type":606,"tag":621,"props":622,"children":624},"code",{"className":623},[],[625],{"type":612,"value":626},"strptime()",{"type":612,"value":628}," method provides powerful parsing capabilities for different date formats.",{"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\n\n# Parse different date string formats\ndate_strings = [\n    \"2024-03-15\",\n    \"03/15/2024\",\n    \"March 15, 2024\",\n    \"2024-03-15 14:30:45\"\n]\n\nformats = [\n    \"%Y-%m-%d\",\n    \"%m/%d/%Y\", \n    \"%B %d, %Y\",\n    \"%Y-%m-%d %H:%M:%S\"\n]\n\nfor date_str, fmt in zip(date_strings, formats):\n    parsed = datetime.strptime(date_str, fmt)\n    print(f\"'{date_str}' → {parsed}\")\n","python",[640],{"type":606,"tag":621,"props":641,"children":642},{"__ignoreMap":8},[643,670,678,687,705,719,731,743,751,760,767,783,806,828,849,865,872,879,907,924],{"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\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},"# Parse different date string formats\n",{"type":606,"tag":644,"props":688,"children":689},{"class":646,"line":45},[690,695,700],{"type":606,"tag":644,"props":691,"children":692},{"style":656},[693],{"type":612,"value":694},"date_strings ",{"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}," [\n",{"type":606,"tag":644,"props":706,"children":707},{"class":646,"line":54},[708,714],{"type":606,"tag":644,"props":709,"children":711},{"style":710},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[712],{"type":612,"value":713},"    \"2024-03-15\"",{"type":606,"tag":644,"props":715,"children":716},{"style":656},[717],{"type":612,"value":718},",\n",{"type":606,"tag":644,"props":720,"children":721},{"class":646,"line":63},[722,727],{"type":606,"tag":644,"props":723,"children":724},{"style":710},[725],{"type":612,"value":726},"    \"03/15/2024\"",{"type":606,"tag":644,"props":728,"children":729},{"style":656},[730],{"type":612,"value":718},{"type":606,"tag":644,"props":732,"children":733},{"class":646,"line":72},[734,739],{"type":606,"tag":644,"props":735,"children":736},{"style":710},[737],{"type":612,"value":738},"    \"March 15, 2024\"",{"type":606,"tag":644,"props":740,"children":741},{"style":656},[742],{"type":612,"value":718},{"type":606,"tag":644,"props":744,"children":745},{"class":646,"line":81},[746],{"type":606,"tag":644,"props":747,"children":748},{"style":710},[749],{"type":612,"value":750},"    \"2024-03-15 14:30:45\"\n",{"type":606,"tag":644,"props":752,"children":754},{"class":646,"line":753},9,[755],{"type":606,"tag":644,"props":756,"children":757},{"style":656},[758],{"type":612,"value":759},"]\n",{"type":606,"tag":644,"props":761,"children":762},{"class":646,"line":99},[763],{"type":606,"tag":644,"props":764,"children":765},{"emptyLinePlaceholder":13},[766],{"type":612,"value":677},{"type":606,"tag":644,"props":768,"children":769},{"class":646,"line":108},[770,775,779],{"type":606,"tag":644,"props":771,"children":772},{"style":656},[773],{"type":612,"value":774},"formats ",{"type":606,"tag":644,"props":776,"children":777},{"style":650},[778],{"type":612,"value":699},{"type":606,"tag":644,"props":780,"children":781},{"style":656},[782],{"type":612,"value":704},{"type":606,"tag":644,"props":784,"children":785},{"class":646,"line":117},[786,791,797,802],{"type":606,"tag":644,"props":787,"children":788},{"style":710},[789],{"type":612,"value":790},"    \"%Y-%m-",{"type":606,"tag":644,"props":792,"children":794},{"style":793},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[795],{"type":612,"value":796},"%d",{"type":606,"tag":644,"props":798,"children":799},{"style":710},[800],{"type":612,"value":801},"\"",{"type":606,"tag":644,"props":803,"children":804},{"style":656},[805],{"type":612,"value":718},{"type":606,"tag":644,"props":807,"children":808},{"class":646,"line":126},[809,814,818,823],{"type":606,"tag":644,"props":810,"children":811},{"style":710},[812],{"type":612,"value":813},"    \"%m/",{"type":606,"tag":644,"props":815,"children":816},{"style":793},[817],{"type":612,"value":796},{"type":606,"tag":644,"props":819,"children":820},{"style":710},[821],{"type":612,"value":822},"/%Y\"",{"type":606,"tag":644,"props":824,"children":825},{"style":656},[826],{"type":612,"value":827},", \n",{"type":606,"tag":644,"props":829,"children":830},{"class":646,"line":135},[831,836,840,845],{"type":606,"tag":644,"props":832,"children":833},{"style":710},[834],{"type":612,"value":835},"    \"%B ",{"type":606,"tag":644,"props":837,"children":838},{"style":793},[839],{"type":612,"value":796},{"type":606,"tag":644,"props":841,"children":842},{"style":710},[843],{"type":612,"value":844},", %Y\"",{"type":606,"tag":644,"props":846,"children":847},{"style":656},[848],{"type":612,"value":718},{"type":606,"tag":644,"props":850,"children":851},{"class":646,"line":144},[852,856,860],{"type":606,"tag":644,"props":853,"children":854},{"style":710},[855],{"type":612,"value":790},{"type":606,"tag":644,"props":857,"children":858},{"style":793},[859],{"type":612,"value":796},{"type":606,"tag":644,"props":861,"children":862},{"style":710},[863],{"type":612,"value":864}," %H:%M:%S\"\n",{"type":606,"tag":644,"props":866,"children":867},{"class":646,"line":153},[868],{"type":606,"tag":644,"props":869,"children":870},{"style":656},[871],{"type":612,"value":759},{"type":606,"tag":644,"props":873,"children":874},{"class":646,"line":163},[875],{"type":606,"tag":644,"props":876,"children":877},{"emptyLinePlaceholder":13},[878],{"type":612,"value":677},{"type":606,"tag":644,"props":880,"children":881},{"class":646,"line":172},[882,887,892,897,902],{"type":606,"tag":644,"props":883,"children":884},{"style":650},[885],{"type":612,"value":886},"for",{"type":606,"tag":644,"props":888,"children":889},{"style":656},[890],{"type":612,"value":891}," date_str, fmt ",{"type":606,"tag":644,"props":893,"children":894},{"style":650},[895],{"type":612,"value":896},"in",{"type":606,"tag":644,"props":898,"children":899},{"style":793},[900],{"type":612,"value":901}," zip",{"type":606,"tag":644,"props":903,"children":904},{"style":656},[905],{"type":612,"value":906},"(date_strings, formats):\n",{"type":606,"tag":644,"props":908,"children":909},{"class":646,"line":181},[910,915,919],{"type":606,"tag":644,"props":911,"children":912},{"style":656},[913],{"type":612,"value":914},"    parsed ",{"type":606,"tag":644,"props":916,"children":917},{"style":650},[918],{"type":612,"value":699},{"type":606,"tag":644,"props":920,"children":921},{"style":656},[922],{"type":612,"value":923}," datetime.strptime(date_str, fmt)\n",{"type":606,"tag":644,"props":925,"children":926},{"class":646,"line":190},[927,932,937,942,947,952,957,962,967,971,976,980,984],{"type":606,"tag":644,"props":928,"children":929},{"style":793},[930],{"type":612,"value":931},"    print",{"type":606,"tag":644,"props":933,"children":934},{"style":656},[935],{"type":612,"value":936},"(",{"type":606,"tag":644,"props":938,"children":939},{"style":650},[940],{"type":612,"value":941},"f",{"type":606,"tag":644,"props":943,"children":944},{"style":710},[945],{"type":612,"value":946},"\"'",{"type":606,"tag":644,"props":948,"children":949},{"style":793},[950],{"type":612,"value":951},"{",{"type":606,"tag":644,"props":953,"children":954},{"style":656},[955],{"type":612,"value":956},"date_str",{"type":606,"tag":644,"props":958,"children":959},{"style":793},[960],{"type":612,"value":961},"}",{"type":606,"tag":644,"props":963,"children":964},{"style":710},[965],{"type":612,"value":966},"' → ",{"type":606,"tag":644,"props":968,"children":969},{"style":793},[970],{"type":612,"value":951},{"type":606,"tag":644,"props":972,"children":973},{"style":656},[974],{"type":612,"value":975},"parsed",{"type":606,"tag":644,"props":977,"children":978},{"style":793},[979],{"type":612,"value":961},{"type":606,"tag":644,"props":981,"children":982},{"style":710},[983],{"type":612,"value":801},{"type":606,"tag":644,"props":985,"children":986},{"style":656},[987],{"type":612,"value":988},")\n",{"type":606,"tag":990,"props":991,"children":993},"h2",{"id":992},"understanding-strptime",[994],{"type":612,"value":995},"🎯 Understanding strptime()",{"type":606,"tag":615,"props":997,"children":998},{},[999,1001,1006],{"type":612,"value":1000},"The ",{"type":606,"tag":621,"props":1002,"children":1004},{"className":1003},[],[1005],{"type":612,"value":626},{"type":612,"value":1007}," method converts strings to datetime objects using format codes.",{"type":606,"tag":1009,"props":1010,"children":1014},"info-box",{"emoji":1011,"title":1012,"type":1013},"🔄","strptime() vs strftime()","info",[1015,1025,1071,1081,1120],{"type":606,"tag":615,"props":1016,"children":1017},{},[1018,1023],{"type":606,"tag":1019,"props":1020,"children":1021},"strong",{},[1022],{"type":612,"value":626},{"type":612,"value":1024}," (string parse time):",{"type":606,"tag":1026,"props":1027,"children":1028},"ul",{},[1029,1047,1052],{"type":606,"tag":1030,"props":1031,"children":1032},"li",{},[1033,1038,1040,1045],{"type":606,"tag":1019,"props":1034,"children":1035},{},[1036],{"type":612,"value":1037},"Input",{"type":612,"value":1039},": String → ",{"type":606,"tag":1019,"props":1041,"children":1042},{},[1043],{"type":612,"value":1044},"Output",{"type":612,"value":1046},": datetime",{"type":606,"tag":1030,"props":1048,"children":1049},{},[1050],{"type":612,"value":1051},"Parse text into datetime objects",{"type":606,"tag":1030,"props":1053,"children":1054},{},[1055,1057,1063,1065],{"type":612,"value":1056},"Example: ",{"type":606,"tag":621,"props":1058,"children":1060},{"className":1059},[],[1061],{"type":612,"value":1062},"\"2024-03-15\"",{"type":612,"value":1064}," → ",{"type":606,"tag":621,"props":1066,"children":1068},{"className":1067},[],[1069],{"type":612,"value":1070},"datetime(2024, 3, 15)",{"type":606,"tag":615,"props":1072,"children":1073},{},[1074,1079],{"type":606,"tag":1019,"props":1075,"children":1076},{},[1077],{"type":612,"value":1078},"strftime()",{"type":612,"value":1080}," (string format time):",{"type":606,"tag":1026,"props":1082,"children":1083},{},[1084,1099,1104],{"type":606,"tag":1030,"props":1085,"children":1086},{},[1087,1091,1093,1097],{"type":606,"tag":1019,"props":1088,"children":1089},{},[1090],{"type":612,"value":1037},{"type":612,"value":1092},": datetime → ",{"type":606,"tag":1019,"props":1094,"children":1095},{},[1096],{"type":612,"value":1044},{"type":612,"value":1098},": String",{"type":606,"tag":1030,"props":1100,"children":1101},{},[1102],{"type":612,"value":1103},"Format datetime for display",{"type":606,"tag":1030,"props":1105,"children":1106},{},[1107,1108,1113,1114],{"type":612,"value":1056},{"type":606,"tag":621,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":612,"value":1070},{"type":612,"value":1064},{"type":606,"tag":621,"props":1115,"children":1117},{"className":1116},[],[1118],{"type":612,"value":1119},"\"March 15, 2024\"",{"type":606,"tag":615,"props":1121,"children":1122},{},[1123,1128,1130,1134,1136,1140,1142,1146,1148,1152],{"type":606,"tag":1019,"props":1124,"children":1125},{},[1126],{"type":612,"value":1127},"Remember",{"type":612,"value":1129},": ",{"type":606,"tag":1019,"props":1131,"children":1132},{},[1133],{"type":612,"value":615},{"type":612,"value":1135},"arse = ",{"type":606,"tag":1019,"props":1137,"children":1138},{},[1139],{"type":612,"value":615},{"type":612,"value":1141},"ython object, ",{"type":606,"tag":1019,"props":1143,"children":1144},{},[1145],{"type":612,"value":941},{"type":612,"value":1147},"ormat = ",{"type":606,"tag":1019,"props":1149,"children":1150},{},[1151],{"type":612,"value":941},{"type":612,"value":1153},"ormatted string",{"type":606,"tag":1155,"props":1156,"children":1158},"h3",{"id":1157},"basic-string-parsing",[1159],{"type":612,"value":1160},"Basic String Parsing",{"type":606,"tag":630,"props":1162,"children":1163},{},[1164],{"type":606,"tag":634,"props":1165,"children":1167},{"className":636,"code":1166,"language":638,"meta":8,"style":8},"from datetime import datetime\n\n# Common date formats\niso_date = datetime.strptime(\"2024-03-15\", \"%Y-%m-%d\")\nus_date = datetime.strptime(\"03/15/2024\", \"%m/%d/%Y\")\neuropean_date = datetime.strptime(\"15/03/2024\", \"%d/%m/%Y\")\n\nprint(f\"ISO date: {iso_date}\")\nprint(f\"US date: {us_date}\")  \nprint(f\"European date: {european_date}\")\n\n# Date with time\ndatetime_str = \"2024-03-15 14:30:45\"\nfull_datetime = datetime.strptime(datetime_str, \"%Y-%m-%d %H:%M:%S\")\nprint(f\"Full datetime: {full_datetime}\")\n",[1168],{"type":606,"tag":621,"props":1169,"children":1170},{"__ignoreMap":8},[1171,1190,1197,1205,1248,1290,1332,1339,1381,1423,1464,1471,1479,1496,1530],{"type":606,"tag":644,"props":1172,"children":1173},{"class":646,"line":12},[1174,1178,1182,1186],{"type":606,"tag":644,"props":1175,"children":1176},{"style":650},[1177],{"type":612,"value":653},{"type":606,"tag":644,"props":1179,"children":1180},{"style":656},[1181],{"type":612,"value":659},{"type":606,"tag":644,"props":1183,"children":1184},{"style":650},[1185],{"type":612,"value":664},{"type":606,"tag":644,"props":1187,"children":1188},{"style":656},[1189],{"type":612,"value":669},{"type":606,"tag":644,"props":1191,"children":1192},{"class":646,"line":27},[1193],{"type":606,"tag":644,"props":1194,"children":1195},{"emptyLinePlaceholder":13},[1196],{"type":612,"value":677},{"type":606,"tag":644,"props":1198,"children":1199},{"class":646,"line":36},[1200],{"type":606,"tag":644,"props":1201,"children":1202},{"style":683},[1203],{"type":612,"value":1204},"# Common date formats\n",{"type":606,"tag":644,"props":1206,"children":1207},{"class":646,"line":45},[1208,1213,1217,1222,1226,1231,1236,1240,1244],{"type":606,"tag":644,"props":1209,"children":1210},{"style":656},[1211],{"type":612,"value":1212},"iso_date ",{"type":606,"tag":644,"props":1214,"children":1215},{"style":650},[1216],{"type":612,"value":699},{"type":606,"tag":644,"props":1218,"children":1219},{"style":656},[1220],{"type":612,"value":1221}," datetime.strptime(",{"type":606,"tag":644,"props":1223,"children":1224},{"style":710},[1225],{"type":612,"value":1062},{"type":606,"tag":644,"props":1227,"children":1228},{"style":656},[1229],{"type":612,"value":1230},", ",{"type":606,"tag":644,"props":1232,"children":1233},{"style":710},[1234],{"type":612,"value":1235},"\"%Y-%m-",{"type":606,"tag":644,"props":1237,"children":1238},{"style":793},[1239],{"type":612,"value":796},{"type":606,"tag":644,"props":1241,"children":1242},{"style":710},[1243],{"type":612,"value":801},{"type":606,"tag":644,"props":1245,"children":1246},{"style":656},[1247],{"type":612,"value":988},{"type":606,"tag":644,"props":1249,"children":1250},{"class":646,"line":54},[1251,1256,1260,1264,1269,1273,1278,1282,1286],{"type":606,"tag":644,"props":1252,"children":1253},{"style":656},[1254],{"type":612,"value":1255},"us_date ",{"type":606,"tag":644,"props":1257,"children":1258},{"style":650},[1259],{"type":612,"value":699},{"type":606,"tag":644,"props":1261,"children":1262},{"style":656},[1263],{"type":612,"value":1221},{"type":606,"tag":644,"props":1265,"children":1266},{"style":710},[1267],{"type":612,"value":1268},"\"03/15/2024\"",{"type":606,"tag":644,"props":1270,"children":1271},{"style":656},[1272],{"type":612,"value":1230},{"type":606,"tag":644,"props":1274,"children":1275},{"style":710},[1276],{"type":612,"value":1277},"\"%m/",{"type":606,"tag":644,"props":1279,"children":1280},{"style":793},[1281],{"type":612,"value":796},{"type":606,"tag":644,"props":1283,"children":1284},{"style":710},[1285],{"type":612,"value":822},{"type":606,"tag":644,"props":1287,"children":1288},{"style":656},[1289],{"type":612,"value":988},{"type":606,"tag":644,"props":1291,"children":1292},{"class":646,"line":63},[1293,1298,1302,1306,1311,1315,1319,1323,1328],{"type":606,"tag":644,"props":1294,"children":1295},{"style":656},[1296],{"type":612,"value":1297},"european_date ",{"type":606,"tag":644,"props":1299,"children":1300},{"style":650},[1301],{"type":612,"value":699},{"type":606,"tag":644,"props":1303,"children":1304},{"style":656},[1305],{"type":612,"value":1221},{"type":606,"tag":644,"props":1307,"children":1308},{"style":710},[1309],{"type":612,"value":1310},"\"15/03/2024\"",{"type":606,"tag":644,"props":1312,"children":1313},{"style":656},[1314],{"type":612,"value":1230},{"type":606,"tag":644,"props":1316,"children":1317},{"style":710},[1318],{"type":612,"value":801},{"type":606,"tag":644,"props":1320,"children":1321},{"style":793},[1322],{"type":612,"value":796},{"type":606,"tag":644,"props":1324,"children":1325},{"style":710},[1326],{"type":612,"value":1327},"/%m/%Y\"",{"type":606,"tag":644,"props":1329,"children":1330},{"style":656},[1331],{"type":612,"value":988},{"type":606,"tag":644,"props":1333,"children":1334},{"class":646,"line":72},[1335],{"type":606,"tag":644,"props":1336,"children":1337},{"emptyLinePlaceholder":13},[1338],{"type":612,"value":677},{"type":606,"tag":644,"props":1340,"children":1341},{"class":646,"line":81},[1342,1347,1351,1355,1360,1364,1369,1373,1377],{"type":606,"tag":644,"props":1343,"children":1344},{"style":793},[1345],{"type":612,"value":1346},"print",{"type":606,"tag":644,"props":1348,"children":1349},{"style":656},[1350],{"type":612,"value":936},{"type":606,"tag":644,"props":1352,"children":1353},{"style":650},[1354],{"type":612,"value":941},{"type":606,"tag":644,"props":1356,"children":1357},{"style":710},[1358],{"type":612,"value":1359},"\"ISO date: ",{"type":606,"tag":644,"props":1361,"children":1362},{"style":793},[1363],{"type":612,"value":951},{"type":606,"tag":644,"props":1365,"children":1366},{"style":656},[1367],{"type":612,"value":1368},"iso_date",{"type":606,"tag":644,"props":1370,"children":1371},{"style":793},[1372],{"type":612,"value":961},{"type":606,"tag":644,"props":1374,"children":1375},{"style":710},[1376],{"type":612,"value":801},{"type":606,"tag":644,"props":1378,"children":1379},{"style":656},[1380],{"type":612,"value":988},{"type":606,"tag":644,"props":1382,"children":1383},{"class":646,"line":753},[1384,1388,1392,1396,1401,1405,1410,1414,1418],{"type":606,"tag":644,"props":1385,"children":1386},{"style":793},[1387],{"type":612,"value":1346},{"type":606,"tag":644,"props":1389,"children":1390},{"style":656},[1391],{"type":612,"value":936},{"type":606,"tag":644,"props":1393,"children":1394},{"style":650},[1395],{"type":612,"value":941},{"type":606,"tag":644,"props":1397,"children":1398},{"style":710},[1399],{"type":612,"value":1400},"\"US date: ",{"type":606,"tag":644,"props":1402,"children":1403},{"style":793},[1404],{"type":612,"value":951},{"type":606,"tag":644,"props":1406,"children":1407},{"style":656},[1408],{"type":612,"value":1409},"us_date",{"type":606,"tag":644,"props":1411,"children":1412},{"style":793},[1413],{"type":612,"value":961},{"type":606,"tag":644,"props":1415,"children":1416},{"style":710},[1417],{"type":612,"value":801},{"type":606,"tag":644,"props":1419,"children":1420},{"style":656},[1421],{"type":612,"value":1422},")  \n",{"type":606,"tag":644,"props":1424,"children":1425},{"class":646,"line":99},[1426,1430,1434,1438,1443,1447,1452,1456,1460],{"type":606,"tag":644,"props":1427,"children":1428},{"style":793},[1429],{"type":612,"value":1346},{"type":606,"tag":644,"props":1431,"children":1432},{"style":656},[1433],{"type":612,"value":936},{"type":606,"tag":644,"props":1435,"children":1436},{"style":650},[1437],{"type":612,"value":941},{"type":606,"tag":644,"props":1439,"children":1440},{"style":710},[1441],{"type":612,"value":1442},"\"European date: ",{"type":606,"tag":644,"props":1444,"children":1445},{"style":793},[1446],{"type":612,"value":951},{"type":606,"tag":644,"props":1448,"children":1449},{"style":656},[1450],{"type":612,"value":1451},"european_date",{"type":606,"tag":644,"props":1453,"children":1454},{"style":793},[1455],{"type":612,"value":961},{"type":606,"tag":644,"props":1457,"children":1458},{"style":710},[1459],{"type":612,"value":801},{"type":606,"tag":644,"props":1461,"children":1462},{"style":656},[1463],{"type":612,"value":988},{"type":606,"tag":644,"props":1465,"children":1466},{"class":646,"line":108},[1467],{"type":606,"tag":644,"props":1468,"children":1469},{"emptyLinePlaceholder":13},[1470],{"type":612,"value":677},{"type":606,"tag":644,"props":1472,"children":1473},{"class":646,"line":117},[1474],{"type":606,"tag":644,"props":1475,"children":1476},{"style":683},[1477],{"type":612,"value":1478},"# Date with time\n",{"type":606,"tag":644,"props":1480,"children":1481},{"class":646,"line":126},[1482,1487,1491],{"type":606,"tag":644,"props":1483,"children":1484},{"style":656},[1485],{"type":612,"value":1486},"datetime_str ",{"type":606,"tag":644,"props":1488,"children":1489},{"style":650},[1490],{"type":612,"value":699},{"type":606,"tag":644,"props":1492,"children":1493},{"style":710},[1494],{"type":612,"value":1495}," \"2024-03-15 14:30:45\"\n",{"type":606,"tag":644,"props":1497,"children":1498},{"class":646,"line":135},[1499,1504,1508,1513,1517,1521,1526],{"type":606,"tag":644,"props":1500,"children":1501},{"style":656},[1502],{"type":612,"value":1503},"full_datetime ",{"type":606,"tag":644,"props":1505,"children":1506},{"style":650},[1507],{"type":612,"value":699},{"type":606,"tag":644,"props":1509,"children":1510},{"style":656},[1511],{"type":612,"value":1512}," datetime.strptime(datetime_str, ",{"type":606,"tag":644,"props":1514,"children":1515},{"style":710},[1516],{"type":612,"value":1235},{"type":606,"tag":644,"props":1518,"children":1519},{"style":793},[1520],{"type":612,"value":796},{"type":606,"tag":644,"props":1522,"children":1523},{"style":710},[1524],{"type":612,"value":1525}," %H:%M:%S\"",{"type":606,"tag":644,"props":1527,"children":1528},{"style":656},[1529],{"type":612,"value":988},{"type":606,"tag":644,"props":1531,"children":1532},{"class":646,"line":144},[1533,1537,1541,1545,1550,1554,1559,1563,1567],{"type":606,"tag":644,"props":1534,"children":1535},{"style":793},[1536],{"type":612,"value":1346},{"type":606,"tag":644,"props":1538,"children":1539},{"style":656},[1540],{"type":612,"value":936},{"type":606,"tag":644,"props":1542,"children":1543},{"style":650},[1544],{"type":612,"value":941},{"type":606,"tag":644,"props":1546,"children":1547},{"style":710},[1548],{"type":612,"value":1549},"\"Full datetime: ",{"type":606,"tag":644,"props":1551,"children":1552},{"style":793},[1553],{"type":612,"value":951},{"type":606,"tag":644,"props":1555,"children":1556},{"style":656},[1557],{"type":612,"value":1558},"full_datetime",{"type":606,"tag":644,"props":1560,"children":1561},{"style":793},[1562],{"type":612,"value":961},{"type":606,"tag":644,"props":1564,"children":1565},{"style":710},[1566],{"type":612,"value":801},{"type":606,"tag":644,"props":1568,"children":1569},{"style":656},[1570],{"type":612,"value":988},{"type":606,"tag":1155,"props":1572,"children":1574},{"id":1573},"handling-different-time-formats",[1575],{"type":612,"value":1576},"Handling Different Time Formats",{"type":606,"tag":630,"props":1578,"children":1579},{},[1580],{"type":606,"tag":634,"props":1581,"children":1583},{"className":636,"code":1582,"language":638,"meta":8,"style":8},"from datetime import datetime\n\n# Various time formats\ntime_formats = [\n    (\"14:30:45\", \"%H:%M:%S\"),           # 24-hour\n    (\"2:30:45 PM\", \"%I:%M:%S %p\"),      # 12-hour with AM/PM\n    (\"2:30 PM\", \"%I:%M %p\"),            # 12-hour without seconds\n    (\"14:30\", \"%H:%M\"),                 # 24-hour without seconds\n]\n\nfor time_str, fmt in time_formats:\n    try:\n        # Parse time only (date defaults to 1900-01-01)\n        parsed = datetime.strptime(time_str, fmt)\n        print(f\"'{time_str}' → {parsed.time()}\")\n    except ValueError as e:\n        print(f\"Error parsing '{time_str}': {e}\")\n",[1584],{"type":606,"tag":621,"props":1585,"children":1586},{"__ignoreMap":8},[1587,1606,1613,1621,1637,1669,1700,1731,1762,1769,1776,1797,1810,1818,1835,1893,1916],{"type":606,"tag":644,"props":1588,"children":1589},{"class":646,"line":12},[1590,1594,1598,1602],{"type":606,"tag":644,"props":1591,"children":1592},{"style":650},[1593],{"type":612,"value":653},{"type":606,"tag":644,"props":1595,"children":1596},{"style":656},[1597],{"type":612,"value":659},{"type":606,"tag":644,"props":1599,"children":1600},{"style":650},[1601],{"type":612,"value":664},{"type":606,"tag":644,"props":1603,"children":1604},{"style":656},[1605],{"type":612,"value":669},{"type":606,"tag":644,"props":1607,"children":1608},{"class":646,"line":27},[1609],{"type":606,"tag":644,"props":1610,"children":1611},{"emptyLinePlaceholder":13},[1612],{"type":612,"value":677},{"type":606,"tag":644,"props":1614,"children":1615},{"class":646,"line":36},[1616],{"type":606,"tag":644,"props":1617,"children":1618},{"style":683},[1619],{"type":612,"value":1620},"# Various time formats\n",{"type":606,"tag":644,"props":1622,"children":1623},{"class":646,"line":45},[1624,1629,1633],{"type":606,"tag":644,"props":1625,"children":1626},{"style":656},[1627],{"type":612,"value":1628},"time_formats ",{"type":606,"tag":644,"props":1630,"children":1631},{"style":650},[1632],{"type":612,"value":699},{"type":606,"tag":644,"props":1634,"children":1635},{"style":656},[1636],{"type":612,"value":704},{"type":606,"tag":644,"props":1638,"children":1639},{"class":646,"line":54},[1640,1645,1650,1654,1659,1664],{"type":606,"tag":644,"props":1641,"children":1642},{"style":656},[1643],{"type":612,"value":1644},"    (",{"type":606,"tag":644,"props":1646,"children":1647},{"style":710},[1648],{"type":612,"value":1649},"\"14:30:45\"",{"type":606,"tag":644,"props":1651,"children":1652},{"style":656},[1653],{"type":612,"value":1230},{"type":606,"tag":644,"props":1655,"children":1656},{"style":710},[1657],{"type":612,"value":1658},"\"%H:%M:%S\"",{"type":606,"tag":644,"props":1660,"children":1661},{"style":656},[1662],{"type":612,"value":1663},"),           ",{"type":606,"tag":644,"props":1665,"children":1666},{"style":683},[1667],{"type":612,"value":1668},"# 24-hour\n",{"type":606,"tag":644,"props":1670,"children":1671},{"class":646,"line":63},[1672,1676,1681,1685,1690,1695],{"type":606,"tag":644,"props":1673,"children":1674},{"style":656},[1675],{"type":612,"value":1644},{"type":606,"tag":644,"props":1677,"children":1678},{"style":710},[1679],{"type":612,"value":1680},"\"2:30:45 PM\"",{"type":606,"tag":644,"props":1682,"children":1683},{"style":656},[1684],{"type":612,"value":1230},{"type":606,"tag":644,"props":1686,"children":1687},{"style":710},[1688],{"type":612,"value":1689},"\"%I:%M:%S %p\"",{"type":606,"tag":644,"props":1691,"children":1692},{"style":656},[1693],{"type":612,"value":1694},"),      ",{"type":606,"tag":644,"props":1696,"children":1697},{"style":683},[1698],{"type":612,"value":1699},"# 12-hour with AM/PM\n",{"type":606,"tag":644,"props":1701,"children":1702},{"class":646,"line":72},[1703,1707,1712,1716,1721,1726],{"type":606,"tag":644,"props":1704,"children":1705},{"style":656},[1706],{"type":612,"value":1644},{"type":606,"tag":644,"props":1708,"children":1709},{"style":710},[1710],{"type":612,"value":1711},"\"2:30 PM\"",{"type":606,"tag":644,"props":1713,"children":1714},{"style":656},[1715],{"type":612,"value":1230},{"type":606,"tag":644,"props":1717,"children":1718},{"style":710},[1719],{"type":612,"value":1720},"\"%I:%M %p\"",{"type":606,"tag":644,"props":1722,"children":1723},{"style":656},[1724],{"type":612,"value":1725},"),            ",{"type":606,"tag":644,"props":1727,"children":1728},{"style":683},[1729],{"type":612,"value":1730},"# 12-hour without seconds\n",{"type":606,"tag":644,"props":1732,"children":1733},{"class":646,"line":81},[1734,1738,1743,1747,1752,1757],{"type":606,"tag":644,"props":1735,"children":1736},{"style":656},[1737],{"type":612,"value":1644},{"type":606,"tag":644,"props":1739,"children":1740},{"style":710},[1741],{"type":612,"value":1742},"\"14:30\"",{"type":606,"tag":644,"props":1744,"children":1745},{"style":656},[1746],{"type":612,"value":1230},{"type":606,"tag":644,"props":1748,"children":1749},{"style":710},[1750],{"type":612,"value":1751},"\"%H:%M\"",{"type":606,"tag":644,"props":1753,"children":1754},{"style":656},[1755],{"type":612,"value":1756},"),                 ",{"type":606,"tag":644,"props":1758,"children":1759},{"style":683},[1760],{"type":612,"value":1761},"# 24-hour without seconds\n",{"type":606,"tag":644,"props":1763,"children":1764},{"class":646,"line":753},[1765],{"type":606,"tag":644,"props":1766,"children":1767},{"style":656},[1768],{"type":612,"value":759},{"type":606,"tag":644,"props":1770,"children":1771},{"class":646,"line":99},[1772],{"type":606,"tag":644,"props":1773,"children":1774},{"emptyLinePlaceholder":13},[1775],{"type":612,"value":677},{"type":606,"tag":644,"props":1777,"children":1778},{"class":646,"line":108},[1779,1783,1788,1792],{"type":606,"tag":644,"props":1780,"children":1781},{"style":650},[1782],{"type":612,"value":886},{"type":606,"tag":644,"props":1784,"children":1785},{"style":656},[1786],{"type":612,"value":1787}," time_str, fmt ",{"type":606,"tag":644,"props":1789,"children":1790},{"style":650},[1791],{"type":612,"value":896},{"type":606,"tag":644,"props":1793,"children":1794},{"style":656},[1795],{"type":612,"value":1796}," time_formats:\n",{"type":606,"tag":644,"props":1798,"children":1799},{"class":646,"line":117},[1800,1805],{"type":606,"tag":644,"props":1801,"children":1802},{"style":650},[1803],{"type":612,"value":1804},"    try",{"type":606,"tag":644,"props":1806,"children":1807},{"style":656},[1808],{"type":612,"value":1809},":\n",{"type":606,"tag":644,"props":1811,"children":1812},{"class":646,"line":126},[1813],{"type":606,"tag":644,"props":1814,"children":1815},{"style":683},[1816],{"type":612,"value":1817},"        # Parse time only (date defaults to 1900-01-01)\n",{"type":606,"tag":644,"props":1819,"children":1820},{"class":646,"line":135},[1821,1826,1830],{"type":606,"tag":644,"props":1822,"children":1823},{"style":656},[1824],{"type":612,"value":1825},"        parsed ",{"type":606,"tag":644,"props":1827,"children":1828},{"style":650},[1829],{"type":612,"value":699},{"type":606,"tag":644,"props":1831,"children":1832},{"style":656},[1833],{"type":612,"value":1834}," datetime.strptime(time_str, fmt)\n",{"type":606,"tag":644,"props":1836,"children":1837},{"class":646,"line":144},[1838,1843,1847,1851,1855,1859,1864,1868,1872,1876,1881,1885,1889],{"type":606,"tag":644,"props":1839,"children":1840},{"style":793},[1841],{"type":612,"value":1842},"        print",{"type":606,"tag":644,"props":1844,"children":1845},{"style":656},[1846],{"type":612,"value":936},{"type":606,"tag":644,"props":1848,"children":1849},{"style":650},[1850],{"type":612,"value":941},{"type":606,"tag":644,"props":1852,"children":1853},{"style":710},[1854],{"type":612,"value":946},{"type":606,"tag":644,"props":1856,"children":1857},{"style":793},[1858],{"type":612,"value":951},{"type":606,"tag":644,"props":1860,"children":1861},{"style":656},[1862],{"type":612,"value":1863},"time_str",{"type":606,"tag":644,"props":1865,"children":1866},{"style":793},[1867],{"type":612,"value":961},{"type":606,"tag":644,"props":1869,"children":1870},{"style":710},[1871],{"type":612,"value":966},{"type":606,"tag":644,"props":1873,"children":1874},{"style":793},[1875],{"type":612,"value":951},{"type":606,"tag":644,"props":1877,"children":1878},{"style":656},[1879],{"type":612,"value":1880},"parsed.time()",{"type":606,"tag":644,"props":1882,"children":1883},{"style":793},[1884],{"type":612,"value":961},{"type":606,"tag":644,"props":1886,"children":1887},{"style":710},[1888],{"type":612,"value":801},{"type":606,"tag":644,"props":1890,"children":1891},{"style":656},[1892],{"type":612,"value":988},{"type":606,"tag":644,"props":1894,"children":1895},{"class":646,"line":153},[1896,1901,1906,1911],{"type":606,"tag":644,"props":1897,"children":1898},{"style":650},[1899],{"type":612,"value":1900},"    except",{"type":606,"tag":644,"props":1902,"children":1903},{"style":793},[1904],{"type":612,"value":1905}," ValueError",{"type":606,"tag":644,"props":1907,"children":1908},{"style":650},[1909],{"type":612,"value":1910}," as",{"type":606,"tag":644,"props":1912,"children":1913},{"style":656},[1914],{"type":612,"value":1915}," e:\n",{"type":606,"tag":644,"props":1917,"children":1918},{"class":646,"line":163},[1919,1923,1927,1931,1936,1940,1944,1948,1953,1957,1962,1966,1970],{"type":606,"tag":644,"props":1920,"children":1921},{"style":793},[1922],{"type":612,"value":1842},{"type":606,"tag":644,"props":1924,"children":1925},{"style":656},[1926],{"type":612,"value":936},{"type":606,"tag":644,"props":1928,"children":1929},{"style":650},[1930],{"type":612,"value":941},{"type":606,"tag":644,"props":1932,"children":1933},{"style":710},[1934],{"type":612,"value":1935},"\"Error parsing '",{"type":606,"tag":644,"props":1937,"children":1938},{"style":793},[1939],{"type":612,"value":951},{"type":606,"tag":644,"props":1941,"children":1942},{"style":656},[1943],{"type":612,"value":1863},{"type":606,"tag":644,"props":1945,"children":1946},{"style":793},[1947],{"type":612,"value":961},{"type":606,"tag":644,"props":1949,"children":1950},{"style":710},[1951],{"type":612,"value":1952},"': ",{"type":606,"tag":644,"props":1954,"children":1955},{"style":793},[1956],{"type":612,"value":951},{"type":606,"tag":644,"props":1958,"children":1959},{"style":656},[1960],{"type":612,"value":1961},"e",{"type":606,"tag":644,"props":1963,"children":1964},{"style":793},[1965],{"type":612,"value":961},{"type":606,"tag":644,"props":1967,"children":1968},{"style":710},[1969],{"type":612,"value":801},{"type":606,"tag":644,"props":1971,"children":1972},{"style":656},[1973],{"type":612,"value":988},{"type":606,"tag":1155,"props":1975,"children":1977},{"id":1976},"named-month-parsing",[1978],{"type":612,"value":1979},"Named Month Parsing",{"type":606,"tag":630,"props":1981,"children":1982},{},[1983],{"type":606,"tag":634,"props":1984,"children":1986},{"className":636,"code":1985,"language":638,"meta":8,"style":8},"from datetime import datetime\n\n# Different month name formats\nmonth_formats = [\n    (\"March 15, 2024\", \"%B %d, %Y\"),        # Full month name\n    (\"Mar 15, 2024\", \"%b %d, %Y\"),          # Abbreviated month\n    (\"15 March 2024\", \"%d %B %Y\"),          # Day first\n    (\"2024, March 15\", \"%Y, %B %d\"),        # Year first\n]\n\nfor date_str, fmt in month_formats:\n    try:\n        parsed = datetime.strptime(date_str, fmt)\n        print(f\"'{date_str}' → {parsed.strftime('%Y-%m-%d')}\")\n    except ValueError as e:\n        print(f\"Error: {e}\")\n",[1987],{"type":606,"tag":621,"props":1988,"children":1989},{"__ignoreMap":8},[1990,2009,2016,2024,2040,2078,2122,2160,2198,2205,2212,2232,2243,2258,2333,2352],{"type":606,"tag":644,"props":1991,"children":1992},{"class":646,"line":12},[1993,1997,2001,2005],{"type":606,"tag":644,"props":1994,"children":1995},{"style":650},[1996],{"type":612,"value":653},{"type":606,"tag":644,"props":1998,"children":1999},{"style":656},[2000],{"type":612,"value":659},{"type":606,"tag":644,"props":2002,"children":2003},{"style":650},[2004],{"type":612,"value":664},{"type":606,"tag":644,"props":2006,"children":2007},{"style":656},[2008],{"type":612,"value":669},{"type":606,"tag":644,"props":2010,"children":2011},{"class":646,"line":27},[2012],{"type":606,"tag":644,"props":2013,"children":2014},{"emptyLinePlaceholder":13},[2015],{"type":612,"value":677},{"type":606,"tag":644,"props":2017,"children":2018},{"class":646,"line":36},[2019],{"type":606,"tag":644,"props":2020,"children":2021},{"style":683},[2022],{"type":612,"value":2023},"# Different month name formats\n",{"type":606,"tag":644,"props":2025,"children":2026},{"class":646,"line":45},[2027,2032,2036],{"type":606,"tag":644,"props":2028,"children":2029},{"style":656},[2030],{"type":612,"value":2031},"month_formats ",{"type":606,"tag":644,"props":2033,"children":2034},{"style":650},[2035],{"type":612,"value":699},{"type":606,"tag":644,"props":2037,"children":2038},{"style":656},[2039],{"type":612,"value":704},{"type":606,"tag":644,"props":2041,"children":2042},{"class":646,"line":54},[2043,2047,2051,2055,2060,2064,2068,2073],{"type":606,"tag":644,"props":2044,"children":2045},{"style":656},[2046],{"type":612,"value":1644},{"type":606,"tag":644,"props":2048,"children":2049},{"style":710},[2050],{"type":612,"value":1119},{"type":606,"tag":644,"props":2052,"children":2053},{"style":656},[2054],{"type":612,"value":1230},{"type":606,"tag":644,"props":2056,"children":2057},{"style":710},[2058],{"type":612,"value":2059},"\"%B ",{"type":606,"tag":644,"props":2061,"children":2062},{"style":793},[2063],{"type":612,"value":796},{"type":606,"tag":644,"props":2065,"children":2066},{"style":710},[2067],{"type":612,"value":844},{"type":606,"tag":644,"props":2069,"children":2070},{"style":656},[2071],{"type":612,"value":2072},"),        ",{"type":606,"tag":644,"props":2074,"children":2075},{"style":683},[2076],{"type":612,"value":2077},"# Full month name\n",{"type":606,"tag":644,"props":2079,"children":2080},{"class":646,"line":63},[2081,2085,2090,2094,2098,2103,2108,2112,2117],{"type":606,"tag":644,"props":2082,"children":2083},{"style":656},[2084],{"type":612,"value":1644},{"type":606,"tag":644,"props":2086,"children":2087},{"style":710},[2088],{"type":612,"value":2089},"\"Mar 15, 2024\"",{"type":606,"tag":644,"props":2091,"children":2092},{"style":656},[2093],{"type":612,"value":1230},{"type":606,"tag":644,"props":2095,"children":2096},{"style":710},[2097],{"type":612,"value":801},{"type":606,"tag":644,"props":2099,"children":2100},{"style":793},[2101],{"type":612,"value":2102},"%b",{"type":606,"tag":644,"props":2104,"children":2105},{"style":793},[2106],{"type":612,"value":2107}," %d",{"type":606,"tag":644,"props":2109,"children":2110},{"style":710},[2111],{"type":612,"value":844},{"type":606,"tag":644,"props":2113,"children":2114},{"style":656},[2115],{"type":612,"value":2116},"),          ",{"type":606,"tag":644,"props":2118,"children":2119},{"style":683},[2120],{"type":612,"value":2121},"# Abbreviated month\n",{"type":606,"tag":644,"props":2123,"children":2124},{"class":646,"line":72},[2125,2129,2134,2138,2142,2146,2151,2155],{"type":606,"tag":644,"props":2126,"children":2127},{"style":656},[2128],{"type":612,"value":1644},{"type":606,"tag":644,"props":2130,"children":2131},{"style":710},[2132],{"type":612,"value":2133},"\"15 March 2024\"",{"type":606,"tag":644,"props":2135,"children":2136},{"style":656},[2137],{"type":612,"value":1230},{"type":606,"tag":644,"props":2139,"children":2140},{"style":710},[2141],{"type":612,"value":801},{"type":606,"tag":644,"props":2143,"children":2144},{"style":793},[2145],{"type":612,"value":796},{"type":606,"tag":644,"props":2147,"children":2148},{"style":710},[2149],{"type":612,"value":2150}," %B %Y\"",{"type":606,"tag":644,"props":2152,"children":2153},{"style":656},[2154],{"type":612,"value":2116},{"type":606,"tag":644,"props":2156,"children":2157},{"style":683},[2158],{"type":612,"value":2159},"# Day first\n",{"type":606,"tag":644,"props":2161,"children":2162},{"class":646,"line":81},[2163,2167,2172,2176,2181,2185,2189,2193],{"type":606,"tag":644,"props":2164,"children":2165},{"style":656},[2166],{"type":612,"value":1644},{"type":606,"tag":644,"props":2168,"children":2169},{"style":710},[2170],{"type":612,"value":2171},"\"2024, March 15\"",{"type":606,"tag":644,"props":2173,"children":2174},{"style":656},[2175],{"type":612,"value":1230},{"type":606,"tag":644,"props":2177,"children":2178},{"style":710},[2179],{"type":612,"value":2180},"\"%Y, %B ",{"type":606,"tag":644,"props":2182,"children":2183},{"style":793},[2184],{"type":612,"value":796},{"type":606,"tag":644,"props":2186,"children":2187},{"style":710},[2188],{"type":612,"value":801},{"type":606,"tag":644,"props":2190,"children":2191},{"style":656},[2192],{"type":612,"value":2072},{"type":606,"tag":644,"props":2194,"children":2195},{"style":683},[2196],{"type":612,"value":2197},"# Year first\n",{"type":606,"tag":644,"props":2199,"children":2200},{"class":646,"line":753},[2201],{"type":606,"tag":644,"props":2202,"children":2203},{"style":656},[2204],{"type":612,"value":759},{"type":606,"tag":644,"props":2206,"children":2207},{"class":646,"line":99},[2208],{"type":606,"tag":644,"props":2209,"children":2210},{"emptyLinePlaceholder":13},[2211],{"type":612,"value":677},{"type":606,"tag":644,"props":2213,"children":2214},{"class":646,"line":108},[2215,2219,2223,2227],{"type":606,"tag":644,"props":2216,"children":2217},{"style":650},[2218],{"type":612,"value":886},{"type":606,"tag":644,"props":2220,"children":2221},{"style":656},[2222],{"type":612,"value":891},{"type":606,"tag":644,"props":2224,"children":2225},{"style":650},[2226],{"type":612,"value":896},{"type":606,"tag":644,"props":2228,"children":2229},{"style":656},[2230],{"type":612,"value":2231}," month_formats:\n",{"type":606,"tag":644,"props":2233,"children":2234},{"class":646,"line":117},[2235,2239],{"type":606,"tag":644,"props":2236,"children":2237},{"style":650},[2238],{"type":612,"value":1804},{"type":606,"tag":644,"props":2240,"children":2241},{"style":656},[2242],{"type":612,"value":1809},{"type":606,"tag":644,"props":2244,"children":2245},{"class":646,"line":126},[2246,2250,2254],{"type":606,"tag":644,"props":2247,"children":2248},{"style":656},[2249],{"type":612,"value":1825},{"type":606,"tag":644,"props":2251,"children":2252},{"style":650},[2253],{"type":612,"value":699},{"type":606,"tag":644,"props":2255,"children":2256},{"style":656},[2257],{"type":612,"value":923},{"type":606,"tag":644,"props":2259,"children":2260},{"class":646,"line":135},[2261,2265,2269,2273,2277,2281,2285,2289,2293,2297,2302,2307,2311,2316,2321,2325,2329],{"type":606,"tag":644,"props":2262,"children":2263},{"style":793},[2264],{"type":612,"value":1842},{"type":606,"tag":644,"props":2266,"children":2267},{"style":656},[2268],{"type":612,"value":936},{"type":606,"tag":644,"props":2270,"children":2271},{"style":650},[2272],{"type":612,"value":941},{"type":606,"tag":644,"props":2274,"children":2275},{"style":710},[2276],{"type":612,"value":946},{"type":606,"tag":644,"props":2278,"children":2279},{"style":793},[2280],{"type":612,"value":951},{"type":606,"tag":644,"props":2282,"children":2283},{"style":656},[2284],{"type":612,"value":956},{"type":606,"tag":644,"props":2286,"children":2287},{"style":793},[2288],{"type":612,"value":961},{"type":606,"tag":644,"props":2290,"children":2291},{"style":710},[2292],{"type":612,"value":966},{"type":606,"tag":644,"props":2294,"children":2295},{"style":793},[2296],{"type":612,"value":951},{"type":606,"tag":644,"props":2298,"children":2299},{"style":656},[2300],{"type":612,"value":2301},"parsed.strftime(",{"type":606,"tag":644,"props":2303,"children":2304},{"style":710},[2305],{"type":612,"value":2306},"'%Y-%m-",{"type":606,"tag":644,"props":2308,"children":2309},{"style":793},[2310],{"type":612,"value":796},{"type":606,"tag":644,"props":2312,"children":2313},{"style":710},[2314],{"type":612,"value":2315},"'",{"type":606,"tag":644,"props":2317,"children":2318},{"style":656},[2319],{"type":612,"value":2320},")",{"type":606,"tag":644,"props":2322,"children":2323},{"style":793},[2324],{"type":612,"value":961},{"type":606,"tag":644,"props":2326,"children":2327},{"style":710},[2328],{"type":612,"value":801},{"type":606,"tag":644,"props":2330,"children":2331},{"style":656},[2332],{"type":612,"value":988},{"type":606,"tag":644,"props":2334,"children":2335},{"class":646,"line":144},[2336,2340,2344,2348],{"type":606,"tag":644,"props":2337,"children":2338},{"style":650},[2339],{"type":612,"value":1900},{"type":606,"tag":644,"props":2341,"children":2342},{"style":793},[2343],{"type":612,"value":1905},{"type":606,"tag":644,"props":2345,"children":2346},{"style":650},[2347],{"type":612,"value":1910},{"type":606,"tag":644,"props":2349,"children":2350},{"style":656},[2351],{"type":612,"value":1915},{"type":606,"tag":644,"props":2353,"children":2354},{"class":646,"line":153},[2355,2359,2363,2367,2372,2376,2380,2384,2388],{"type":606,"tag":644,"props":2356,"children":2357},{"style":793},[2358],{"type":612,"value":1842},{"type":606,"tag":644,"props":2360,"children":2361},{"style":656},[2362],{"type":612,"value":936},{"type":606,"tag":644,"props":2364,"children":2365},{"style":650},[2366],{"type":612,"value":941},{"type":606,"tag":644,"props":2368,"children":2369},{"style":710},[2370],{"type":612,"value":2371},"\"Error: ",{"type":606,"tag":644,"props":2373,"children":2374},{"style":793},[2375],{"type":612,"value":951},{"type":606,"tag":644,"props":2377,"children":2378},{"style":656},[2379],{"type":612,"value":1961},{"type":606,"tag":644,"props":2381,"children":2382},{"style":793},[2383],{"type":612,"value":961},{"type":606,"tag":644,"props":2385,"children":2386},{"style":710},[2387],{"type":612,"value":801},{"type":606,"tag":644,"props":2389,"children":2390},{"style":656},[2391],{"type":612,"value":988},{"type":606,"tag":990,"props":2393,"children":2395},{"id":2394},"️-flexible-date-parsing",[2396],{"type":612,"value":2397},"🛠️ Flexible Date Parsing",{"type":606,"tag":615,"props":2399,"children":2400},{},[2401],{"type":612,"value":2402},"Handle multiple formats and provide robust parsing solutions.",{"type":606,"tag":1155,"props":2404,"children":2406},{"id":2405},"multi-format-parser",[2407],{"type":612,"value":2408},"Multi-Format Parser",{"type":606,"tag":630,"props":2410,"children":2411},{},[2412],{"type":606,"tag":634,"props":2413,"children":2415},{"className":636,"code":2414,"language":638,"meta":8,"style":8},"from datetime import datetime\n\ndef parse_date_flexible(date_string):\n    \"\"\"Try to parse date string with multiple formats\"\"\"\n    formats = [\n        \"%Y-%m-%d\",           # 2024-03-15\n        \"%m/%d/%Y\",           # 03/15/2024\n        \"%d/%m/%Y\",           # 15/03/2024\n        \"%B %d, %Y\",          # March 15, 2024\n        \"%b %d, %Y\",          # Mar 15, 2024\n        \"%d %B %Y\",           # 15 March 2024\n        \"%Y-%m-%d %H:%M:%S\",  # 2024-03-15 14:30:45\n        \"%m/%d/%Y %I:%M %p\",  # 03/15/2024 2:30 PM\n    ]\n    \n    for fmt in formats:\n        try:\n            return datetime.strptime(date_string, fmt)\n        except ValueError:\n            continue\n    \n    raise ValueError(f\"Unable to parse date: {date_string}\")\n\n# Test with various formats\ntest_dates = [\n    \"2024-03-15\",\n    \"03/15/2024\", \n    \"March 15, 2024\",\n    \"2024-03-15 14:30:45\",\n    \"Invalid date\"\n]\n\nfor date_str in test_dates:\n    try:\n        parsed = parse_date_flexible(date_str)\n        print(f\"✓ '{date_str}' → {parsed}\")\n    except ValueError as e:\n        print(f\"✗ {e}\")\n",[2416],{"type":606,"tag":621,"props":2417,"children":2418},{"__ignoreMap":8},[2419,2438,2445,2464,2472,2488,2514,2539,2564,2590,2618,2642,2667,2692,2700,2708,2730,2742,2755,2771,2779,2786,2832,2839,2847,2863,2874,2885,2896,2908,2916,2923,2930,2951,2962,2978,3034,3053],{"type":606,"tag":644,"props":2420,"children":2421},{"class":646,"line":12},[2422,2426,2430,2434],{"type":606,"tag":644,"props":2423,"children":2424},{"style":650},[2425],{"type":612,"value":653},{"type":606,"tag":644,"props":2427,"children":2428},{"style":656},[2429],{"type":612,"value":659},{"type":606,"tag":644,"props":2431,"children":2432},{"style":650},[2433],{"type":612,"value":664},{"type":606,"tag":644,"props":2435,"children":2436},{"style":656},[2437],{"type":612,"value":669},{"type":606,"tag":644,"props":2439,"children":2440},{"class":646,"line":27},[2441],{"type":606,"tag":644,"props":2442,"children":2443},{"emptyLinePlaceholder":13},[2444],{"type":612,"value":677},{"type":606,"tag":644,"props":2446,"children":2447},{"class":646,"line":36},[2448,2453,2459],{"type":606,"tag":644,"props":2449,"children":2450},{"style":650},[2451],{"type":612,"value":2452},"def",{"type":606,"tag":644,"props":2454,"children":2456},{"style":2455},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2457],{"type":612,"value":2458}," parse_date_flexible",{"type":606,"tag":644,"props":2460,"children":2461},{"style":656},[2462],{"type":612,"value":2463},"(date_string):\n",{"type":606,"tag":644,"props":2465,"children":2466},{"class":646,"line":45},[2467],{"type":606,"tag":644,"props":2468,"children":2469},{"style":710},[2470],{"type":612,"value":2471},"    \"\"\"Try to parse date string with multiple formats\"\"\"\n",{"type":606,"tag":644,"props":2473,"children":2474},{"class":646,"line":54},[2475,2480,2484],{"type":606,"tag":644,"props":2476,"children":2477},{"style":656},[2478],{"type":612,"value":2479},"    formats ",{"type":606,"tag":644,"props":2481,"children":2482},{"style":650},[2483],{"type":612,"value":699},{"type":606,"tag":644,"props":2485,"children":2486},{"style":656},[2487],{"type":612,"value":704},{"type":606,"tag":644,"props":2489,"children":2490},{"class":646,"line":63},[2491,2496,2500,2504,2509],{"type":606,"tag":644,"props":2492,"children":2493},{"style":710},[2494],{"type":612,"value":2495},"        \"%Y-%m-",{"type":606,"tag":644,"props":2497,"children":2498},{"style":793},[2499],{"type":612,"value":796},{"type":606,"tag":644,"props":2501,"children":2502},{"style":710},[2503],{"type":612,"value":801},{"type":606,"tag":644,"props":2505,"children":2506},{"style":656},[2507],{"type":612,"value":2508},",           ",{"type":606,"tag":644,"props":2510,"children":2511},{"style":683},[2512],{"type":612,"value":2513},"# 2024-03-15\n",{"type":606,"tag":644,"props":2515,"children":2516},{"class":646,"line":72},[2517,2522,2526,2530,2534],{"type":606,"tag":644,"props":2518,"children":2519},{"style":710},[2520],{"type":612,"value":2521},"        \"%m/",{"type":606,"tag":644,"props":2523,"children":2524},{"style":793},[2525],{"type":612,"value":796},{"type":606,"tag":644,"props":2527,"children":2528},{"style":710},[2529],{"type":612,"value":822},{"type":606,"tag":644,"props":2531,"children":2532},{"style":656},[2533],{"type":612,"value":2508},{"type":606,"tag":644,"props":2535,"children":2536},{"style":683},[2537],{"type":612,"value":2538},"# 03/15/2024\n",{"type":606,"tag":644,"props":2540,"children":2541},{"class":646,"line":81},[2542,2547,2551,2555,2559],{"type":606,"tag":644,"props":2543,"children":2544},{"style":710},[2545],{"type":612,"value":2546},"        \"",{"type":606,"tag":644,"props":2548,"children":2549},{"style":793},[2550],{"type":612,"value":796},{"type":606,"tag":644,"props":2552,"children":2553},{"style":710},[2554],{"type":612,"value":1327},{"type":606,"tag":644,"props":2556,"children":2557},{"style":656},[2558],{"type":612,"value":2508},{"type":606,"tag":644,"props":2560,"children":2561},{"style":683},[2562],{"type":612,"value":2563},"# 15/03/2024\n",{"type":606,"tag":644,"props":2565,"children":2566},{"class":646,"line":753},[2567,2572,2576,2580,2585],{"type":606,"tag":644,"props":2568,"children":2569},{"style":710},[2570],{"type":612,"value":2571},"        \"%B ",{"type":606,"tag":644,"props":2573,"children":2574},{"style":793},[2575],{"type":612,"value":796},{"type":606,"tag":644,"props":2577,"children":2578},{"style":710},[2579],{"type":612,"value":844},{"type":606,"tag":644,"props":2581,"children":2582},{"style":656},[2583],{"type":612,"value":2584},",          ",{"type":606,"tag":644,"props":2586,"children":2587},{"style":683},[2588],{"type":612,"value":2589},"# March 15, 2024\n",{"type":606,"tag":644,"props":2591,"children":2592},{"class":646,"line":99},[2593,2597,2601,2605,2609,2613],{"type":606,"tag":644,"props":2594,"children":2595},{"style":710},[2596],{"type":612,"value":2546},{"type":606,"tag":644,"props":2598,"children":2599},{"style":793},[2600],{"type":612,"value":2102},{"type":606,"tag":644,"props":2602,"children":2603},{"style":793},[2604],{"type":612,"value":2107},{"type":606,"tag":644,"props":2606,"children":2607},{"style":710},[2608],{"type":612,"value":844},{"type":606,"tag":644,"props":2610,"children":2611},{"style":656},[2612],{"type":612,"value":2584},{"type":606,"tag":644,"props":2614,"children":2615},{"style":683},[2616],{"type":612,"value":2617},"# Mar 15, 2024\n",{"type":606,"tag":644,"props":2619,"children":2620},{"class":646,"line":108},[2621,2625,2629,2633,2637],{"type":606,"tag":644,"props":2622,"children":2623},{"style":710},[2624],{"type":612,"value":2546},{"type":606,"tag":644,"props":2626,"children":2627},{"style":793},[2628],{"type":612,"value":796},{"type":606,"tag":644,"props":2630,"children":2631},{"style":710},[2632],{"type":612,"value":2150},{"type":606,"tag":644,"props":2634,"children":2635},{"style":656},[2636],{"type":612,"value":2508},{"type":606,"tag":644,"props":2638,"children":2639},{"style":683},[2640],{"type":612,"value":2641},"# 15 March 2024\n",{"type":606,"tag":644,"props":2643,"children":2644},{"class":646,"line":117},[2645,2649,2653,2657,2662],{"type":606,"tag":644,"props":2646,"children":2647},{"style":710},[2648],{"type":612,"value":2495},{"type":606,"tag":644,"props":2650,"children":2651},{"style":793},[2652],{"type":612,"value":796},{"type":606,"tag":644,"props":2654,"children":2655},{"style":710},[2656],{"type":612,"value":1525},{"type":606,"tag":644,"props":2658,"children":2659},{"style":656},[2660],{"type":612,"value":2661},",  ",{"type":606,"tag":644,"props":2663,"children":2664},{"style":683},[2665],{"type":612,"value":2666},"# 2024-03-15 14:30:45\n",{"type":606,"tag":644,"props":2668,"children":2669},{"class":646,"line":126},[2670,2674,2678,2683,2687],{"type":606,"tag":644,"props":2671,"children":2672},{"style":710},[2673],{"type":612,"value":2521},{"type":606,"tag":644,"props":2675,"children":2676},{"style":793},[2677],{"type":612,"value":796},{"type":606,"tag":644,"props":2679,"children":2680},{"style":710},[2681],{"type":612,"value":2682},"/%Y %I:%M %p\"",{"type":606,"tag":644,"props":2684,"children":2685},{"style":656},[2686],{"type":612,"value":2661},{"type":606,"tag":644,"props":2688,"children":2689},{"style":683},[2690],{"type":612,"value":2691},"# 03/15/2024 2:30 PM\n",{"type":606,"tag":644,"props":2693,"children":2694},{"class":646,"line":135},[2695],{"type":606,"tag":644,"props":2696,"children":2697},{"style":656},[2698],{"type":612,"value":2699},"    ]\n",{"type":606,"tag":644,"props":2701,"children":2702},{"class":646,"line":144},[2703],{"type":606,"tag":644,"props":2704,"children":2705},{"style":656},[2706],{"type":612,"value":2707},"    \n",{"type":606,"tag":644,"props":2709,"children":2710},{"class":646,"line":153},[2711,2716,2721,2725],{"type":606,"tag":644,"props":2712,"children":2713},{"style":650},[2714],{"type":612,"value":2715},"    for",{"type":606,"tag":644,"props":2717,"children":2718},{"style":656},[2719],{"type":612,"value":2720}," fmt ",{"type":606,"tag":644,"props":2722,"children":2723},{"style":650},[2724],{"type":612,"value":896},{"type":606,"tag":644,"props":2726,"children":2727},{"style":656},[2728],{"type":612,"value":2729}," formats:\n",{"type":606,"tag":644,"props":2731,"children":2732},{"class":646,"line":163},[2733,2738],{"type":606,"tag":644,"props":2734,"children":2735},{"style":650},[2736],{"type":612,"value":2737},"        try",{"type":606,"tag":644,"props":2739,"children":2740},{"style":656},[2741],{"type":612,"value":1809},{"type":606,"tag":644,"props":2743,"children":2744},{"class":646,"line":172},[2745,2750],{"type":606,"tag":644,"props":2746,"children":2747},{"style":650},[2748],{"type":612,"value":2749},"            return",{"type":606,"tag":644,"props":2751,"children":2752},{"style":656},[2753],{"type":612,"value":2754}," datetime.strptime(date_string, fmt)\n",{"type":606,"tag":644,"props":2756,"children":2757},{"class":646,"line":181},[2758,2763,2767],{"type":606,"tag":644,"props":2759,"children":2760},{"style":650},[2761],{"type":612,"value":2762},"        except",{"type":606,"tag":644,"props":2764,"children":2765},{"style":793},[2766],{"type":612,"value":1905},{"type":606,"tag":644,"props":2768,"children":2769},{"style":656},[2770],{"type":612,"value":1809},{"type":606,"tag":644,"props":2772,"children":2773},{"class":646,"line":190},[2774],{"type":606,"tag":644,"props":2775,"children":2776},{"style":650},[2777],{"type":612,"value":2778},"            continue\n",{"type":606,"tag":644,"props":2780,"children":2781},{"class":646,"line":199},[2782],{"type":606,"tag":644,"props":2783,"children":2784},{"style":656},[2785],{"type":612,"value":2707},{"type":606,"tag":644,"props":2787,"children":2788},{"class":646,"line":208},[2789,2794,2798,2802,2806,2811,2815,2820,2824,2828],{"type":606,"tag":644,"props":2790,"children":2791},{"style":650},[2792],{"type":612,"value":2793},"    raise",{"type":606,"tag":644,"props":2795,"children":2796},{"style":793},[2797],{"type":612,"value":1905},{"type":606,"tag":644,"props":2799,"children":2800},{"style":656},[2801],{"type":612,"value":936},{"type":606,"tag":644,"props":2803,"children":2804},{"style":650},[2805],{"type":612,"value":941},{"type":606,"tag":644,"props":2807,"children":2808},{"style":710},[2809],{"type":612,"value":2810},"\"Unable to parse date: ",{"type":606,"tag":644,"props":2812,"children":2813},{"style":793},[2814],{"type":612,"value":951},{"type":606,"tag":644,"props":2816,"children":2817},{"style":656},[2818],{"type":612,"value":2819},"date_string",{"type":606,"tag":644,"props":2821,"children":2822},{"style":793},[2823],{"type":612,"value":961},{"type":606,"tag":644,"props":2825,"children":2826},{"style":710},[2827],{"type":612,"value":801},{"type":606,"tag":644,"props":2829,"children":2830},{"style":656},[2831],{"type":612,"value":988},{"type":606,"tag":644,"props":2833,"children":2834},{"class":646,"line":217},[2835],{"type":606,"tag":644,"props":2836,"children":2837},{"emptyLinePlaceholder":13},[2838],{"type":612,"value":677},{"type":606,"tag":644,"props":2840,"children":2841},{"class":646,"line":227},[2842],{"type":606,"tag":644,"props":2843,"children":2844},{"style":683},[2845],{"type":612,"value":2846},"# Test with various formats\n",{"type":606,"tag":644,"props":2848,"children":2849},{"class":646,"line":236},[2850,2855,2859],{"type":606,"tag":644,"props":2851,"children":2852},{"style":656},[2853],{"type":612,"value":2854},"test_dates ",{"type":606,"tag":644,"props":2856,"children":2857},{"style":650},[2858],{"type":612,"value":699},{"type":606,"tag":644,"props":2860,"children":2861},{"style":656},[2862],{"type":612,"value":704},{"type":606,"tag":644,"props":2864,"children":2865},{"class":646,"line":245},[2866,2870],{"type":606,"tag":644,"props":2867,"children":2868},{"style":710},[2869],{"type":612,"value":713},{"type":606,"tag":644,"props":2871,"children":2872},{"style":656},[2873],{"type":612,"value":718},{"type":606,"tag":644,"props":2875,"children":2876},{"class":646,"line":254},[2877,2881],{"type":606,"tag":644,"props":2878,"children":2879},{"style":710},[2880],{"type":612,"value":726},{"type":606,"tag":644,"props":2882,"children":2883},{"style":656},[2884],{"type":612,"value":827},{"type":606,"tag":644,"props":2886,"children":2887},{"class":646,"line":263},[2888,2892],{"type":606,"tag":644,"props":2889,"children":2890},{"style":710},[2891],{"type":612,"value":738},{"type":606,"tag":644,"props":2893,"children":2894},{"style":656},[2895],{"type":612,"value":718},{"type":606,"tag":644,"props":2897,"children":2898},{"class":646,"line":272},[2899,2904],{"type":606,"tag":644,"props":2900,"children":2901},{"style":710},[2902],{"type":612,"value":2903},"    \"2024-03-15 14:30:45\"",{"type":606,"tag":644,"props":2905,"children":2906},{"style":656},[2907],{"type":612,"value":718},{"type":606,"tag":644,"props":2909,"children":2910},{"class":646,"line":281},[2911],{"type":606,"tag":644,"props":2912,"children":2913},{"style":710},[2914],{"type":612,"value":2915},"    \"Invalid date\"\n",{"type":606,"tag":644,"props":2917,"children":2918},{"class":646,"line":291},[2919],{"type":606,"tag":644,"props":2920,"children":2921},{"style":656},[2922],{"type":612,"value":759},{"type":606,"tag":644,"props":2924,"children":2925},{"class":646,"line":302},[2926],{"type":606,"tag":644,"props":2927,"children":2928},{"emptyLinePlaceholder":13},[2929],{"type":612,"value":677},{"type":606,"tag":644,"props":2931,"children":2932},{"class":646,"line":311},[2933,2937,2942,2946],{"type":606,"tag":644,"props":2934,"children":2935},{"style":650},[2936],{"type":612,"value":886},{"type":606,"tag":644,"props":2938,"children":2939},{"style":656},[2940],{"type":612,"value":2941}," date_str ",{"type":606,"tag":644,"props":2943,"children":2944},{"style":650},[2945],{"type":612,"value":896},{"type":606,"tag":644,"props":2947,"children":2948},{"style":656},[2949],{"type":612,"value":2950}," test_dates:\n",{"type":606,"tag":644,"props":2952,"children":2953},{"class":646,"line":320},[2954,2958],{"type":606,"tag":644,"props":2955,"children":2956},{"style":650},[2957],{"type":612,"value":1804},{"type":606,"tag":644,"props":2959,"children":2960},{"style":656},[2961],{"type":612,"value":1809},{"type":606,"tag":644,"props":2963,"children":2964},{"class":646,"line":329},[2965,2969,2973],{"type":606,"tag":644,"props":2966,"children":2967},{"style":656},[2968],{"type":612,"value":1825},{"type":606,"tag":644,"props":2970,"children":2971},{"style":650},[2972],{"type":612,"value":699},{"type":606,"tag":644,"props":2974,"children":2975},{"style":656},[2976],{"type":612,"value":2977}," parse_date_flexible(date_str)\n",{"type":606,"tag":644,"props":2979,"children":2980},{"class":646,"line":338},[2981,2985,2989,2993,2998,3002,3006,3010,3014,3018,3022,3026,3030],{"type":606,"tag":644,"props":2982,"children":2983},{"style":793},[2984],{"type":612,"value":1842},{"type":606,"tag":644,"props":2986,"children":2987},{"style":656},[2988],{"type":612,"value":936},{"type":606,"tag":644,"props":2990,"children":2991},{"style":650},[2992],{"type":612,"value":941},{"type":606,"tag":644,"props":2994,"children":2995},{"style":710},[2996],{"type":612,"value":2997},"\"✓ '",{"type":606,"tag":644,"props":2999,"children":3000},{"style":793},[3001],{"type":612,"value":951},{"type":606,"tag":644,"props":3003,"children":3004},{"style":656},[3005],{"type":612,"value":956},{"type":606,"tag":644,"props":3007,"children":3008},{"style":793},[3009],{"type":612,"value":961},{"type":606,"tag":644,"props":3011,"children":3012},{"style":710},[3013],{"type":612,"value":966},{"type":606,"tag":644,"props":3015,"children":3016},{"style":793},[3017],{"type":612,"value":951},{"type":606,"tag":644,"props":3019,"children":3020},{"style":656},[3021],{"type":612,"value":975},{"type":606,"tag":644,"props":3023,"children":3024},{"style":793},[3025],{"type":612,"value":961},{"type":606,"tag":644,"props":3027,"children":3028},{"style":710},[3029],{"type":612,"value":801},{"type":606,"tag":644,"props":3031,"children":3032},{"style":656},[3033],{"type":612,"value":988},{"type":606,"tag":644,"props":3035,"children":3036},{"class":646,"line":347},[3037,3041,3045,3049],{"type":606,"tag":644,"props":3038,"children":3039},{"style":650},[3040],{"type":612,"value":1900},{"type":606,"tag":644,"props":3042,"children":3043},{"style":793},[3044],{"type":612,"value":1905},{"type":606,"tag":644,"props":3046,"children":3047},{"style":650},[3048],{"type":612,"value":1910},{"type":606,"tag":644,"props":3050,"children":3051},{"style":656},[3052],{"type":612,"value":1915},{"type":606,"tag":644,"props":3054,"children":3055},{"class":646,"line":356},[3056,3060,3064,3068,3073,3077,3081,3085,3089],{"type":606,"tag":644,"props":3057,"children":3058},{"style":793},[3059],{"type":612,"value":1842},{"type":606,"tag":644,"props":3061,"children":3062},{"style":656},[3063],{"type":612,"value":936},{"type":606,"tag":644,"props":3065,"children":3066},{"style":650},[3067],{"type":612,"value":941},{"type":606,"tag":644,"props":3069,"children":3070},{"style":710},[3071],{"type":612,"value":3072},"\"✗ ",{"type":606,"tag":644,"props":3074,"children":3075},{"style":793},[3076],{"type":612,"value":951},{"type":606,"tag":644,"props":3078,"children":3079},{"style":656},[3080],{"type":612,"value":1961},{"type":606,"tag":644,"props":3082,"children":3083},{"style":793},[3084],{"type":612,"value":961},{"type":606,"tag":644,"props":3086,"children":3087},{"style":710},[3088],{"type":612,"value":801},{"type":606,"tag":644,"props":3090,"children":3091},{"style":656},[3092],{"type":612,"value":988},{"type":606,"tag":1155,"props":3094,"children":3096},{"id":3095},"fuzzy-date-parsing",[3097],{"type":612,"value":3098},"Fuzzy Date Parsing",{"type":606,"tag":630,"props":3100,"children":3101},{},[3102],{"type":606,"tag":634,"props":3103,"children":3105},{"className":636,"code":3104,"language":638,"meta":8,"style":8},"from datetime import datetime\nimport re\n\ndef clean_and_parse_date(date_string):\n    \"\"\"Clean and parse date strings with extra text\"\"\"\n    # Remove common extra words and characters\n    cleaned = re.sub(r'\\b(on|at|the)\\b', '', date_string, flags=re.IGNORECASE)\n    cleaned = re.sub(r'[,]+', ',', cleaned)  # Multiple commas\n    cleaned = re.sub(r'\\s+', ' ', cleaned).strip()  # Multiple spaces\n    \n    # Try parsing the cleaned string\n    formats = [\n        \"%B %d %Y\",          # March 15 2024\n        \"%B %d, %Y\",         # March 15, 2024\n        \"%m/%d/%Y\",          # 03/15/2024\n        \"%Y-%m-%d\",          # 2024-03-15\n    ]\n    \n    for fmt in formats:\n        try:\n            return datetime.strptime(cleaned, fmt)\n        except ValueError:\n            continue\n    \n    raise ValueError(f\"Could not parse: {date_string}\")\n\n# Test fuzzy parsing\nfuzzy_dates = [\n    \"on March 15, 2024\",\n    \"the 15th of March, 2024\", \n    \"March  15,,,  2024\",\n    \"at 03/15/2024\"\n]\n\nfor date_str in fuzzy_dates:\n    try:\n        parsed = clean_and_parse_date(date_str)\n        print(f\"✓ '{date_str}' → {parsed.strftime('%Y-%m-%d')}\")\n    except ValueError:\n        print(f\"✗ Could not parse: '{date_str}'\")\n",[3106],{"type":606,"tag":621,"props":3107,"children":3108},{"__ignoreMap":8},[3109,3128,3140,3147,3163,3171,3179,3282,3338,3393,3400,3408,3423,3448,3472,3495,3518,3525,3532,3551,3562,3574,3589,3596,3603,3647,3654,3662,3678,3690,3702,3714,3722,3729,3736,3756,3767,3783,3854,3869],{"type":606,"tag":644,"props":3110,"children":3111},{"class":646,"line":12},[3112,3116,3120,3124],{"type":606,"tag":644,"props":3113,"children":3114},{"style":650},[3115],{"type":612,"value":653},{"type":606,"tag":644,"props":3117,"children":3118},{"style":656},[3119],{"type":612,"value":659},{"type":606,"tag":644,"props":3121,"children":3122},{"style":650},[3123],{"type":612,"value":664},{"type":606,"tag":644,"props":3125,"children":3126},{"style":656},[3127],{"type":612,"value":669},{"type":606,"tag":644,"props":3129,"children":3130},{"class":646,"line":27},[3131,3135],{"type":606,"tag":644,"props":3132,"children":3133},{"style":650},[3134],{"type":612,"value":664},{"type":606,"tag":644,"props":3136,"children":3137},{"style":656},[3138],{"type":612,"value":3139}," re\n",{"type":606,"tag":644,"props":3141,"children":3142},{"class":646,"line":36},[3143],{"type":606,"tag":644,"props":3144,"children":3145},{"emptyLinePlaceholder":13},[3146],{"type":612,"value":677},{"type":606,"tag":644,"props":3148,"children":3149},{"class":646,"line":45},[3150,3154,3159],{"type":606,"tag":644,"props":3151,"children":3152},{"style":650},[3153],{"type":612,"value":2452},{"type":606,"tag":644,"props":3155,"children":3156},{"style":2455},[3157],{"type":612,"value":3158}," clean_and_parse_date",{"type":606,"tag":644,"props":3160,"children":3161},{"style":656},[3162],{"type":612,"value":2463},{"type":606,"tag":644,"props":3164,"children":3165},{"class":646,"line":54},[3166],{"type":606,"tag":644,"props":3167,"children":3168},{"style":710},[3169],{"type":612,"value":3170},"    \"\"\"Clean and parse date strings with extra text\"\"\"\n",{"type":606,"tag":644,"props":3172,"children":3173},{"class":646,"line":63},[3174],{"type":606,"tag":644,"props":3175,"children":3176},{"style":683},[3177],{"type":612,"value":3178},"    # Remove common extra words and characters\n",{"type":606,"tag":644,"props":3180,"children":3181},{"class":646,"line":72},[3182,3187,3191,3196,3201,3205,3210,3216,3221,3226,3230,3235,3240,3244,3248,3253,3258,3264,3268,3273,3278],{"type":606,"tag":644,"props":3183,"children":3184},{"style":656},[3185],{"type":612,"value":3186},"    cleaned ",{"type":606,"tag":644,"props":3188,"children":3189},{"style":650},[3190],{"type":612,"value":699},{"type":606,"tag":644,"props":3192,"children":3193},{"style":656},[3194],{"type":612,"value":3195}," re.sub(",{"type":606,"tag":644,"props":3197,"children":3198},{"style":650},[3199],{"type":612,"value":3200},"r",{"type":606,"tag":644,"props":3202,"children":3203},{"style":710},[3204],{"type":612,"value":2315},{"type":606,"tag":644,"props":3206,"children":3207},{"style":793},[3208],{"type":612,"value":3209},"\\b(",{"type":606,"tag":644,"props":3211,"children":3213},{"style":3212},"--shiki-default:#032F62;--shiki-app-dark-mode:#DBEDFF",[3214],{"type":612,"value":3215},"on",{"type":606,"tag":644,"props":3217,"children":3218},{"style":650},[3219],{"type":612,"value":3220},"|",{"type":606,"tag":644,"props":3222,"children":3223},{"style":3212},[3224],{"type":612,"value":3225},"at",{"type":606,"tag":644,"props":3227,"children":3228},{"style":650},[3229],{"type":612,"value":3220},{"type":606,"tag":644,"props":3231,"children":3232},{"style":3212},[3233],{"type":612,"value":3234},"the",{"type":606,"tag":644,"props":3236,"children":3237},{"style":793},[3238],{"type":612,"value":3239},")\\b",{"type":606,"tag":644,"props":3241,"children":3242},{"style":710},[3243],{"type":612,"value":2315},{"type":606,"tag":644,"props":3245,"children":3246},{"style":656},[3247],{"type":612,"value":1230},{"type":606,"tag":644,"props":3249,"children":3250},{"style":710},[3251],{"type":612,"value":3252},"''",{"type":606,"tag":644,"props":3254,"children":3255},{"style":656},[3256],{"type":612,"value":3257},", date_string, ",{"type":606,"tag":644,"props":3259,"children":3261},{"style":3260},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[3262],{"type":612,"value":3263},"flags",{"type":606,"tag":644,"props":3265,"children":3266},{"style":650},[3267],{"type":612,"value":699},{"type":606,"tag":644,"props":3269,"children":3270},{"style":656},[3271],{"type":612,"value":3272},"re.",{"type":606,"tag":644,"props":3274,"children":3275},{"style":793},[3276],{"type":612,"value":3277},"IGNORECASE",{"type":606,"tag":644,"props":3279,"children":3280},{"style":656},[3281],{"type":612,"value":988},{"type":606,"tag":644,"props":3283,"children":3284},{"class":646,"line":81},[3285,3289,3293,3297,3301,3305,3310,3315,3319,3323,3328,3333],{"type":606,"tag":644,"props":3286,"children":3287},{"style":656},[3288],{"type":612,"value":3186},{"type":606,"tag":644,"props":3290,"children":3291},{"style":650},[3292],{"type":612,"value":699},{"type":606,"tag":644,"props":3294,"children":3295},{"style":656},[3296],{"type":612,"value":3195},{"type":606,"tag":644,"props":3298,"children":3299},{"style":650},[3300],{"type":612,"value":3200},{"type":606,"tag":644,"props":3302,"children":3303},{"style":710},[3304],{"type":612,"value":2315},{"type":606,"tag":644,"props":3306,"children":3307},{"style":793},[3308],{"type":612,"value":3309},"[,]",{"type":606,"tag":644,"props":3311,"children":3312},{"style":650},[3313],{"type":612,"value":3314},"+",{"type":606,"tag":644,"props":3316,"children":3317},{"style":710},[3318],{"type":612,"value":2315},{"type":606,"tag":644,"props":3320,"children":3321},{"style":656},[3322],{"type":612,"value":1230},{"type":606,"tag":644,"props":3324,"children":3325},{"style":710},[3326],{"type":612,"value":3327},"','",{"type":606,"tag":644,"props":3329,"children":3330},{"style":656},[3331],{"type":612,"value":3332},", cleaned)  ",{"type":606,"tag":644,"props":3334,"children":3335},{"style":683},[3336],{"type":612,"value":3337},"# Multiple commas\n",{"type":606,"tag":644,"props":3339,"children":3340},{"class":646,"line":753},[3341,3345,3349,3353,3357,3361,3366,3370,3374,3378,3383,3388],{"type":606,"tag":644,"props":3342,"children":3343},{"style":656},[3344],{"type":612,"value":3186},{"type":606,"tag":644,"props":3346,"children":3347},{"style":650},[3348],{"type":612,"value":699},{"type":606,"tag":644,"props":3350,"children":3351},{"style":656},[3352],{"type":612,"value":3195},{"type":606,"tag":644,"props":3354,"children":3355},{"style":650},[3356],{"type":612,"value":3200},{"type":606,"tag":644,"props":3358,"children":3359},{"style":710},[3360],{"type":612,"value":2315},{"type":606,"tag":644,"props":3362,"children":3363},{"style":793},[3364],{"type":612,"value":3365},"\\s",{"type":606,"tag":644,"props":3367,"children":3368},{"style":650},[3369],{"type":612,"value":3314},{"type":606,"tag":644,"props":3371,"children":3372},{"style":710},[3373],{"type":612,"value":2315},{"type":606,"tag":644,"props":3375,"children":3376},{"style":656},[3377],{"type":612,"value":1230},{"type":606,"tag":644,"props":3379,"children":3380},{"style":710},[3381],{"type":612,"value":3382},"' '",{"type":606,"tag":644,"props":3384,"children":3385},{"style":656},[3386],{"type":612,"value":3387},", cleaned).strip()  ",{"type":606,"tag":644,"props":3389,"children":3390},{"style":683},[3391],{"type":612,"value":3392},"# Multiple spaces\n",{"type":606,"tag":644,"props":3394,"children":3395},{"class":646,"line":99},[3396],{"type":606,"tag":644,"props":3397,"children":3398},{"style":656},[3399],{"type":612,"value":2707},{"type":606,"tag":644,"props":3401,"children":3402},{"class":646,"line":108},[3403],{"type":606,"tag":644,"props":3404,"children":3405},{"style":683},[3406],{"type":612,"value":3407},"    # Try parsing the cleaned string\n",{"type":606,"tag":644,"props":3409,"children":3410},{"class":646,"line":117},[3411,3415,3419],{"type":606,"tag":644,"props":3412,"children":3413},{"style":656},[3414],{"type":612,"value":2479},{"type":606,"tag":644,"props":3416,"children":3417},{"style":650},[3418],{"type":612,"value":699},{"type":606,"tag":644,"props":3420,"children":3421},{"style":656},[3422],{"type":612,"value":704},{"type":606,"tag":644,"props":3424,"children":3425},{"class":646,"line":126},[3426,3430,3434,3439,3443],{"type":606,"tag":644,"props":3427,"children":3428},{"style":710},[3429],{"type":612,"value":2571},{"type":606,"tag":644,"props":3431,"children":3432},{"style":793},[3433],{"type":612,"value":796},{"type":606,"tag":644,"props":3435,"children":3436},{"style":710},[3437],{"type":612,"value":3438}," %Y\"",{"type":606,"tag":644,"props":3440,"children":3441},{"style":656},[3442],{"type":612,"value":2584},{"type":606,"tag":644,"props":3444,"children":3445},{"style":683},[3446],{"type":612,"value":3447},"# March 15 2024\n",{"type":606,"tag":644,"props":3449,"children":3450},{"class":646,"line":135},[3451,3455,3459,3463,3468],{"type":606,"tag":644,"props":3452,"children":3453},{"style":710},[3454],{"type":612,"value":2571},{"type":606,"tag":644,"props":3456,"children":3457},{"style":793},[3458],{"type":612,"value":796},{"type":606,"tag":644,"props":3460,"children":3461},{"style":710},[3462],{"type":612,"value":844},{"type":606,"tag":644,"props":3464,"children":3465},{"style":656},[3466],{"type":612,"value":3467},",         ",{"type":606,"tag":644,"props":3469,"children":3470},{"style":683},[3471],{"type":612,"value":2589},{"type":606,"tag":644,"props":3473,"children":3474},{"class":646,"line":144},[3475,3479,3483,3487,3491],{"type":606,"tag":644,"props":3476,"children":3477},{"style":710},[3478],{"type":612,"value":2521},{"type":606,"tag":644,"props":3480,"children":3481},{"style":793},[3482],{"type":612,"value":796},{"type":606,"tag":644,"props":3484,"children":3485},{"style":710},[3486],{"type":612,"value":822},{"type":606,"tag":644,"props":3488,"children":3489},{"style":656},[3490],{"type":612,"value":2584},{"type":606,"tag":644,"props":3492,"children":3493},{"style":683},[3494],{"type":612,"value":2538},{"type":606,"tag":644,"props":3496,"children":3497},{"class":646,"line":153},[3498,3502,3506,3510,3514],{"type":606,"tag":644,"props":3499,"children":3500},{"style":710},[3501],{"type":612,"value":2495},{"type":606,"tag":644,"props":3503,"children":3504},{"style":793},[3505],{"type":612,"value":796},{"type":606,"tag":644,"props":3507,"children":3508},{"style":710},[3509],{"type":612,"value":801},{"type":606,"tag":644,"props":3511,"children":3512},{"style":656},[3513],{"type":612,"value":2584},{"type":606,"tag":644,"props":3515,"children":3516},{"style":683},[3517],{"type":612,"value":2513},{"type":606,"tag":644,"props":3519,"children":3520},{"class":646,"line":163},[3521],{"type":606,"tag":644,"props":3522,"children":3523},{"style":656},[3524],{"type":612,"value":2699},{"type":606,"tag":644,"props":3526,"children":3527},{"class":646,"line":172},[3528],{"type":606,"tag":644,"props":3529,"children":3530},{"style":656},[3531],{"type":612,"value":2707},{"type":606,"tag":644,"props":3533,"children":3534},{"class":646,"line":181},[3535,3539,3543,3547],{"type":606,"tag":644,"props":3536,"children":3537},{"style":650},[3538],{"type":612,"value":2715},{"type":606,"tag":644,"props":3540,"children":3541},{"style":656},[3542],{"type":612,"value":2720},{"type":606,"tag":644,"props":3544,"children":3545},{"style":650},[3546],{"type":612,"value":896},{"type":606,"tag":644,"props":3548,"children":3549},{"style":656},[3550],{"type":612,"value":2729},{"type":606,"tag":644,"props":3552,"children":3553},{"class":646,"line":190},[3554,3558],{"type":606,"tag":644,"props":3555,"children":3556},{"style":650},[3557],{"type":612,"value":2737},{"type":606,"tag":644,"props":3559,"children":3560},{"style":656},[3561],{"type":612,"value":1809},{"type":606,"tag":644,"props":3563,"children":3564},{"class":646,"line":199},[3565,3569],{"type":606,"tag":644,"props":3566,"children":3567},{"style":650},[3568],{"type":612,"value":2749},{"type":606,"tag":644,"props":3570,"children":3571},{"style":656},[3572],{"type":612,"value":3573}," datetime.strptime(cleaned, fmt)\n",{"type":606,"tag":644,"props":3575,"children":3576},{"class":646,"line":208},[3577,3581,3585],{"type":606,"tag":644,"props":3578,"children":3579},{"style":650},[3580],{"type":612,"value":2762},{"type":606,"tag":644,"props":3582,"children":3583},{"style":793},[3584],{"type":612,"value":1905},{"type":606,"tag":644,"props":3586,"children":3587},{"style":656},[3588],{"type":612,"value":1809},{"type":606,"tag":644,"props":3590,"children":3591},{"class":646,"line":217},[3592],{"type":606,"tag":644,"props":3593,"children":3594},{"style":650},[3595],{"type":612,"value":2778},{"type":606,"tag":644,"props":3597,"children":3598},{"class":646,"line":227},[3599],{"type":606,"tag":644,"props":3600,"children":3601},{"style":656},[3602],{"type":612,"value":2707},{"type":606,"tag":644,"props":3604,"children":3605},{"class":646,"line":236},[3606,3610,3614,3618,3622,3627,3631,3635,3639,3643],{"type":606,"tag":644,"props":3607,"children":3608},{"style":650},[3609],{"type":612,"value":2793},{"type":606,"tag":644,"props":3611,"children":3612},{"style":793},[3613],{"type":612,"value":1905},{"type":606,"tag":644,"props":3615,"children":3616},{"style":656},[3617],{"type":612,"value":936},{"type":606,"tag":644,"props":3619,"children":3620},{"style":650},[3621],{"type":612,"value":941},{"type":606,"tag":644,"props":3623,"children":3624},{"style":710},[3625],{"type":612,"value":3626},"\"Could not parse: ",{"type":606,"tag":644,"props":3628,"children":3629},{"style":793},[3630],{"type":612,"value":951},{"type":606,"tag":644,"props":3632,"children":3633},{"style":656},[3634],{"type":612,"value":2819},{"type":606,"tag":644,"props":3636,"children":3637},{"style":793},[3638],{"type":612,"value":961},{"type":606,"tag":644,"props":3640,"children":3641},{"style":710},[3642],{"type":612,"value":801},{"type":606,"tag":644,"props":3644,"children":3645},{"style":656},[3646],{"type":612,"value":988},{"type":606,"tag":644,"props":3648,"children":3649},{"class":646,"line":245},[3650],{"type":606,"tag":644,"props":3651,"children":3652},{"emptyLinePlaceholder":13},[3653],{"type":612,"value":677},{"type":606,"tag":644,"props":3655,"children":3656},{"class":646,"line":254},[3657],{"type":606,"tag":644,"props":3658,"children":3659},{"style":683},[3660],{"type":612,"value":3661},"# Test fuzzy parsing\n",{"type":606,"tag":644,"props":3663,"children":3664},{"class":646,"line":263},[3665,3670,3674],{"type":606,"tag":644,"props":3666,"children":3667},{"style":656},[3668],{"type":612,"value":3669},"fuzzy_dates ",{"type":606,"tag":644,"props":3671,"children":3672},{"style":650},[3673],{"type":612,"value":699},{"type":606,"tag":644,"props":3675,"children":3676},{"style":656},[3677],{"type":612,"value":704},{"type":606,"tag":644,"props":3679,"children":3680},{"class":646,"line":272},[3681,3686],{"type":606,"tag":644,"props":3682,"children":3683},{"style":710},[3684],{"type":612,"value":3685},"    \"on March 15, 2024\"",{"type":606,"tag":644,"props":3687,"children":3688},{"style":656},[3689],{"type":612,"value":718},{"type":606,"tag":644,"props":3691,"children":3692},{"class":646,"line":281},[3693,3698],{"type":606,"tag":644,"props":3694,"children":3695},{"style":710},[3696],{"type":612,"value":3697},"    \"the 15th of March, 2024\"",{"type":606,"tag":644,"props":3699,"children":3700},{"style":656},[3701],{"type":612,"value":827},{"type":606,"tag":644,"props":3703,"children":3704},{"class":646,"line":291},[3705,3710],{"type":606,"tag":644,"props":3706,"children":3707},{"style":710},[3708],{"type":612,"value":3709},"    \"March  15,,,  2024\"",{"type":606,"tag":644,"props":3711,"children":3712},{"style":656},[3713],{"type":612,"value":718},{"type":606,"tag":644,"props":3715,"children":3716},{"class":646,"line":302},[3717],{"type":606,"tag":644,"props":3718,"children":3719},{"style":710},[3720],{"type":612,"value":3721},"    \"at 03/15/2024\"\n",{"type":606,"tag":644,"props":3723,"children":3724},{"class":646,"line":311},[3725],{"type":606,"tag":644,"props":3726,"children":3727},{"style":656},[3728],{"type":612,"value":759},{"type":606,"tag":644,"props":3730,"children":3731},{"class":646,"line":320},[3732],{"type":606,"tag":644,"props":3733,"children":3734},{"emptyLinePlaceholder":13},[3735],{"type":612,"value":677},{"type":606,"tag":644,"props":3737,"children":3738},{"class":646,"line":329},[3739,3743,3747,3751],{"type":606,"tag":644,"props":3740,"children":3741},{"style":650},[3742],{"type":612,"value":886},{"type":606,"tag":644,"props":3744,"children":3745},{"style":656},[3746],{"type":612,"value":2941},{"type":606,"tag":644,"props":3748,"children":3749},{"style":650},[3750],{"type":612,"value":896},{"type":606,"tag":644,"props":3752,"children":3753},{"style":656},[3754],{"type":612,"value":3755}," fuzzy_dates:\n",{"type":606,"tag":644,"props":3757,"children":3758},{"class":646,"line":338},[3759,3763],{"type":606,"tag":644,"props":3760,"children":3761},{"style":650},[3762],{"type":612,"value":1804},{"type":606,"tag":644,"props":3764,"children":3765},{"style":656},[3766],{"type":612,"value":1809},{"type":606,"tag":644,"props":3768,"children":3769},{"class":646,"line":347},[3770,3774,3778],{"type":606,"tag":644,"props":3771,"children":3772},{"style":656},[3773],{"type":612,"value":1825},{"type":606,"tag":644,"props":3775,"children":3776},{"style":650},[3777],{"type":612,"value":699},{"type":606,"tag":644,"props":3779,"children":3780},{"style":656},[3781],{"type":612,"value":3782}," clean_and_parse_date(date_str)\n",{"type":606,"tag":644,"props":3784,"children":3785},{"class":646,"line":356},[3786,3790,3794,3798,3802,3806,3810,3814,3818,3822,3826,3830,3834,3838,3842,3846,3850],{"type":606,"tag":644,"props":3787,"children":3788},{"style":793},[3789],{"type":612,"value":1842},{"type":606,"tag":644,"props":3791,"children":3792},{"style":656},[3793],{"type":612,"value":936},{"type":606,"tag":644,"props":3795,"children":3796},{"style":650},[3797],{"type":612,"value":941},{"type":606,"tag":644,"props":3799,"children":3800},{"style":710},[3801],{"type":612,"value":2997},{"type":606,"tag":644,"props":3803,"children":3804},{"style":793},[3805],{"type":612,"value":951},{"type":606,"tag":644,"props":3807,"children":3808},{"style":656},[3809],{"type":612,"value":956},{"type":606,"tag":644,"props":3811,"children":3812},{"style":793},[3813],{"type":612,"value":961},{"type":606,"tag":644,"props":3815,"children":3816},{"style":710},[3817],{"type":612,"value":966},{"type":606,"tag":644,"props":3819,"children":3820},{"style":793},[3821],{"type":612,"value":951},{"type":606,"tag":644,"props":3823,"children":3824},{"style":656},[3825],{"type":612,"value":2301},{"type":606,"tag":644,"props":3827,"children":3828},{"style":710},[3829],{"type":612,"value":2306},{"type":606,"tag":644,"props":3831,"children":3832},{"style":793},[3833],{"type":612,"value":796},{"type":606,"tag":644,"props":3835,"children":3836},{"style":710},[3837],{"type":612,"value":2315},{"type":606,"tag":644,"props":3839,"children":3840},{"style":656},[3841],{"type":612,"value":2320},{"type":606,"tag":644,"props":3843,"children":3844},{"style":793},[3845],{"type":612,"value":961},{"type":606,"tag":644,"props":3847,"children":3848},{"style":710},[3849],{"type":612,"value":801},{"type":606,"tag":644,"props":3851,"children":3852},{"style":656},[3853],{"type":612,"value":988},{"type":606,"tag":644,"props":3855,"children":3856},{"class":646,"line":367},[3857,3861,3865],{"type":606,"tag":644,"props":3858,"children":3859},{"style":650},[3860],{"type":612,"value":1900},{"type":606,"tag":644,"props":3862,"children":3863},{"style":793},[3864],{"type":612,"value":1905},{"type":606,"tag":644,"props":3866,"children":3867},{"style":656},[3868],{"type":612,"value":1809},{"type":606,"tag":644,"props":3870,"children":3871},{"class":646,"line":376},[3872,3876,3880,3884,3889,3893,3897,3901,3906],{"type":606,"tag":644,"props":3873,"children":3874},{"style":793},[3875],{"type":612,"value":1842},{"type":606,"tag":644,"props":3877,"children":3878},{"style":656},[3879],{"type":612,"value":936},{"type":606,"tag":644,"props":3881,"children":3882},{"style":650},[3883],{"type":612,"value":941},{"type":606,"tag":644,"props":3885,"children":3886},{"style":710},[3887],{"type":612,"value":3888},"\"✗ Could not parse: '",{"type":606,"tag":644,"props":3890,"children":3891},{"style":793},[3892],{"type":612,"value":951},{"type":606,"tag":644,"props":3894,"children":3895},{"style":656},[3896],{"type":612,"value":956},{"type":606,"tag":644,"props":3898,"children":3899},{"style":793},[3900],{"type":612,"value":961},{"type":606,"tag":644,"props":3902,"children":3903},{"style":710},[3904],{"type":612,"value":3905},"'\"",{"type":606,"tag":644,"props":3907,"children":3908},{"style":656},[3909],{"type":612,"value":988},{"type":606,"tag":1155,"props":3911,"children":3913},{"id":3912},"date-validation",[3914],{"type":612,"value":3915},"Date Validation",{"type":606,"tag":630,"props":3917,"children":3918},{},[3919],{"type":606,"tag":634,"props":3920,"children":3922},{"className":636,"code":3921,"language":638,"meta":8,"style":8},"from datetime import datetime\n\ndef validate_and_parse_date(date_string, min_year=1900, max_year=2100):\n    \"\"\"Parse and validate date with reasonable limits\"\"\"\n    try:\n        # Try common formats\n        formats = [\"%Y-%m-%d\", \"%m/%d/%Y\", \"%d/%m/%Y\", \"%B %d, %Y\"]\n        \n        parsed_date = None\n        for fmt in formats:\n            try:\n                parsed_date = datetime.strptime(date_string, fmt)\n                break\n            except ValueError:\n                continue\n        \n        if parsed_date is None:\n            return None, \"Invalid date format\"\n        \n        # Validate year range\n        if not (min_year \u003C= parsed_date.year \u003C= max_year):\n            return None, f\"Year must be between {min_year} and {max_year}\"\n        \n        # Validate not in future (optional check)\n        if parsed_date > datetime.now():\n            return None, \"Date cannot be in the future\"\n        \n        return parsed_date, \"Valid\"\n        \n    except Exception as e:\n        return None, f\"Error: {str(e)}\"\n\n# Test date validation\ntest_dates = [\n    \"2024-03-15\",      # Valid\n    \"13/15/2024\",      # Invalid month\n    \"2025-12-31\",      # Future date\n    \"1800-01-01\",      # Too old\n    \"invalid\",         # Invalid format\n]\n\nfor date_str in test_dates:\n    result, message = validate_and_parse_date(date_str)\n    status = \"✓\" if result else \"✗\"\n    print(f\"{status} '{date_str}': {message}\")\n    if result:\n        print(f\"   Parsed as: {result.strftime('%B %d, %Y')}\")\n",[3923],{"type":606,"tag":621,"props":3924,"children":3925},{"__ignoreMap":8},[3926,3945,3952,3997,4005,4016,4024,4105,4113,4130,4150,4162,4178,4186,4202,4210,4217,4244,4264,4271,4279,4315,4375,4382,4390,4411,4431,4438,4456,4463,4483,4524,4531,4539,4554,4571,4588,4605,4622,4639,4646,4653,4672,4689,4726,4800,4813],{"type":606,"tag":644,"props":3927,"children":3928},{"class":646,"line":12},[3929,3933,3937,3941],{"type":606,"tag":644,"props":3930,"children":3931},{"style":650},[3932],{"type":612,"value":653},{"type":606,"tag":644,"props":3934,"children":3935},{"style":656},[3936],{"type":612,"value":659},{"type":606,"tag":644,"props":3938,"children":3939},{"style":650},[3940],{"type":612,"value":664},{"type":606,"tag":644,"props":3942,"children":3943},{"style":656},[3944],{"type":612,"value":669},{"type":606,"tag":644,"props":3946,"children":3947},{"class":646,"line":27},[3948],{"type":606,"tag":644,"props":3949,"children":3950},{"emptyLinePlaceholder":13},[3951],{"type":612,"value":677},{"type":606,"tag":644,"props":3953,"children":3954},{"class":646,"line":36},[3955,3959,3964,3969,3973,3978,3983,3987,3992],{"type":606,"tag":644,"props":3956,"children":3957},{"style":650},[3958],{"type":612,"value":2452},{"type":606,"tag":644,"props":3960,"children":3961},{"style":2455},[3962],{"type":612,"value":3963}," validate_and_parse_date",{"type":606,"tag":644,"props":3965,"children":3966},{"style":656},[3967],{"type":612,"value":3968},"(date_string, min_year",{"type":606,"tag":644,"props":3970,"children":3971},{"style":650},[3972],{"type":612,"value":699},{"type":606,"tag":644,"props":3974,"children":3975},{"style":793},[3976],{"type":612,"value":3977},"1900",{"type":606,"tag":644,"props":3979,"children":3980},{"style":656},[3981],{"type":612,"value":3982},", max_year",{"type":606,"tag":644,"props":3984,"children":3985},{"style":650},[3986],{"type":612,"value":699},{"type":606,"tag":644,"props":3988,"children":3989},{"style":793},[3990],{"type":612,"value":3991},"2100",{"type":606,"tag":644,"props":3993,"children":3994},{"style":656},[3995],{"type":612,"value":3996},"):\n",{"type":606,"tag":644,"props":3998,"children":3999},{"class":646,"line":45},[4000],{"type":606,"tag":644,"props":4001,"children":4002},{"style":710},[4003],{"type":612,"value":4004},"    \"\"\"Parse and validate date with reasonable limits\"\"\"\n",{"type":606,"tag":644,"props":4006,"children":4007},{"class":646,"line":54},[4008,4012],{"type":606,"tag":644,"props":4009,"children":4010},{"style":650},[4011],{"type":612,"value":1804},{"type":606,"tag":644,"props":4013,"children":4014},{"style":656},[4015],{"type":612,"value":1809},{"type":606,"tag":644,"props":4017,"children":4018},{"class":646,"line":63},[4019],{"type":606,"tag":644,"props":4020,"children":4021},{"style":683},[4022],{"type":612,"value":4023},"        # Try common formats\n",{"type":606,"tag":644,"props":4025,"children":4026},{"class":646,"line":72},[4027,4032,4036,4041,4045,4049,4053,4057,4061,4065,4069,4073,4077,4081,4085,4089,4093,4097,4101],{"type":606,"tag":644,"props":4028,"children":4029},{"style":656},[4030],{"type":612,"value":4031},"        formats ",{"type":606,"tag":644,"props":4033,"children":4034},{"style":650},[4035],{"type":612,"value":699},{"type":606,"tag":644,"props":4037,"children":4038},{"style":656},[4039],{"type":612,"value":4040}," [",{"type":606,"tag":644,"props":4042,"children":4043},{"style":710},[4044],{"type":612,"value":1235},{"type":606,"tag":644,"props":4046,"children":4047},{"style":793},[4048],{"type":612,"value":796},{"type":606,"tag":644,"props":4050,"children":4051},{"style":710},[4052],{"type":612,"value":801},{"type":606,"tag":644,"props":4054,"children":4055},{"style":656},[4056],{"type":612,"value":1230},{"type":606,"tag":644,"props":4058,"children":4059},{"style":710},[4060],{"type":612,"value":1277},{"type":606,"tag":644,"props":4062,"children":4063},{"style":793},[4064],{"type":612,"value":796},{"type":606,"tag":644,"props":4066,"children":4067},{"style":710},[4068],{"type":612,"value":822},{"type":606,"tag":644,"props":4070,"children":4071},{"style":656},[4072],{"type":612,"value":1230},{"type":606,"tag":644,"props":4074,"children":4075},{"style":710},[4076],{"type":612,"value":801},{"type":606,"tag":644,"props":4078,"children":4079},{"style":793},[4080],{"type":612,"value":796},{"type":606,"tag":644,"props":4082,"children":4083},{"style":710},[4084],{"type":612,"value":1327},{"type":606,"tag":644,"props":4086,"children":4087},{"style":656},[4088],{"type":612,"value":1230},{"type":606,"tag":644,"props":4090,"children":4091},{"style":710},[4092],{"type":612,"value":2059},{"type":606,"tag":644,"props":4094,"children":4095},{"style":793},[4096],{"type":612,"value":796},{"type":606,"tag":644,"props":4098,"children":4099},{"style":710},[4100],{"type":612,"value":844},{"type":606,"tag":644,"props":4102,"children":4103},{"style":656},[4104],{"type":612,"value":759},{"type":606,"tag":644,"props":4106,"children":4107},{"class":646,"line":81},[4108],{"type":606,"tag":644,"props":4109,"children":4110},{"style":656},[4111],{"type":612,"value":4112},"        \n",{"type":606,"tag":644,"props":4114,"children":4115},{"class":646,"line":753},[4116,4121,4125],{"type":606,"tag":644,"props":4117,"children":4118},{"style":656},[4119],{"type":612,"value":4120},"        parsed_date ",{"type":606,"tag":644,"props":4122,"children":4123},{"style":650},[4124],{"type":612,"value":699},{"type":606,"tag":644,"props":4126,"children":4127},{"style":793},[4128],{"type":612,"value":4129}," None\n",{"type":606,"tag":644,"props":4131,"children":4132},{"class":646,"line":99},[4133,4138,4142,4146],{"type":606,"tag":644,"props":4134,"children":4135},{"style":650},[4136],{"type":612,"value":4137},"        for",{"type":606,"tag":644,"props":4139,"children":4140},{"style":656},[4141],{"type":612,"value":2720},{"type":606,"tag":644,"props":4143,"children":4144},{"style":650},[4145],{"type":612,"value":896},{"type":606,"tag":644,"props":4147,"children":4148},{"style":656},[4149],{"type":612,"value":2729},{"type":606,"tag":644,"props":4151,"children":4152},{"class":646,"line":108},[4153,4158],{"type":606,"tag":644,"props":4154,"children":4155},{"style":650},[4156],{"type":612,"value":4157},"            try",{"type":606,"tag":644,"props":4159,"children":4160},{"style":656},[4161],{"type":612,"value":1809},{"type":606,"tag":644,"props":4163,"children":4164},{"class":646,"line":117},[4165,4170,4174],{"type":606,"tag":644,"props":4166,"children":4167},{"style":656},[4168],{"type":612,"value":4169},"                parsed_date ",{"type":606,"tag":644,"props":4171,"children":4172},{"style":650},[4173],{"type":612,"value":699},{"type":606,"tag":644,"props":4175,"children":4176},{"style":656},[4177],{"type":612,"value":2754},{"type":606,"tag":644,"props":4179,"children":4180},{"class":646,"line":126},[4181],{"type":606,"tag":644,"props":4182,"children":4183},{"style":650},[4184],{"type":612,"value":4185},"                break\n",{"type":606,"tag":644,"props":4187,"children":4188},{"class":646,"line":135},[4189,4194,4198],{"type":606,"tag":644,"props":4190,"children":4191},{"style":650},[4192],{"type":612,"value":4193},"            except",{"type":606,"tag":644,"props":4195,"children":4196},{"style":793},[4197],{"type":612,"value":1905},{"type":606,"tag":644,"props":4199,"children":4200},{"style":656},[4201],{"type":612,"value":1809},{"type":606,"tag":644,"props":4203,"children":4204},{"class":646,"line":144},[4205],{"type":606,"tag":644,"props":4206,"children":4207},{"style":650},[4208],{"type":612,"value":4209},"                continue\n",{"type":606,"tag":644,"props":4211,"children":4212},{"class":646,"line":153},[4213],{"type":606,"tag":644,"props":4214,"children":4215},{"style":656},[4216],{"type":612,"value":4112},{"type":606,"tag":644,"props":4218,"children":4219},{"class":646,"line":163},[4220,4225,4230,4235,4240],{"type":606,"tag":644,"props":4221,"children":4222},{"style":650},[4223],{"type":612,"value":4224},"        if",{"type":606,"tag":644,"props":4226,"children":4227},{"style":656},[4228],{"type":612,"value":4229}," parsed_date ",{"type":606,"tag":644,"props":4231,"children":4232},{"style":650},[4233],{"type":612,"value":4234},"is",{"type":606,"tag":644,"props":4236,"children":4237},{"style":793},[4238],{"type":612,"value":4239}," None",{"type":606,"tag":644,"props":4241,"children":4242},{"style":656},[4243],{"type":612,"value":1809},{"type":606,"tag":644,"props":4245,"children":4246},{"class":646,"line":172},[4247,4251,4255,4259],{"type":606,"tag":644,"props":4248,"children":4249},{"style":650},[4250],{"type":612,"value":2749},{"type":606,"tag":644,"props":4252,"children":4253},{"style":793},[4254],{"type":612,"value":4239},{"type":606,"tag":644,"props":4256,"children":4257},{"style":656},[4258],{"type":612,"value":1230},{"type":606,"tag":644,"props":4260,"children":4261},{"style":710},[4262],{"type":612,"value":4263},"\"Invalid date format\"\n",{"type":606,"tag":644,"props":4265,"children":4266},{"class":646,"line":181},[4267],{"type":606,"tag":644,"props":4268,"children":4269},{"style":656},[4270],{"type":612,"value":4112},{"type":606,"tag":644,"props":4272,"children":4273},{"class":646,"line":190},[4274],{"type":606,"tag":644,"props":4275,"children":4276},{"style":683},[4277],{"type":612,"value":4278},"        # Validate year range\n",{"type":606,"tag":644,"props":4280,"children":4281},{"class":646,"line":199},[4282,4286,4291,4296,4301,4306,4310],{"type":606,"tag":644,"props":4283,"children":4284},{"style":650},[4285],{"type":612,"value":4224},{"type":606,"tag":644,"props":4287,"children":4288},{"style":650},[4289],{"type":612,"value":4290}," not",{"type":606,"tag":644,"props":4292,"children":4293},{"style":656},[4294],{"type":612,"value":4295}," (min_year ",{"type":606,"tag":644,"props":4297,"children":4298},{"style":650},[4299],{"type":612,"value":4300},"\u003C=",{"type":606,"tag":644,"props":4302,"children":4303},{"style":656},[4304],{"type":612,"value":4305}," parsed_date.year ",{"type":606,"tag":644,"props":4307,"children":4308},{"style":650},[4309],{"type":612,"value":4300},{"type":606,"tag":644,"props":4311,"children":4312},{"style":656},[4313],{"type":612,"value":4314}," max_year):\n",{"type":606,"tag":644,"props":4316,"children":4317},{"class":646,"line":208},[4318,4322,4326,4330,4334,4339,4343,4348,4352,4357,4361,4366,4370],{"type":606,"tag":644,"props":4319,"children":4320},{"style":650},[4321],{"type":612,"value":2749},{"type":606,"tag":644,"props":4323,"children":4324},{"style":793},[4325],{"type":612,"value":4239},{"type":606,"tag":644,"props":4327,"children":4328},{"style":656},[4329],{"type":612,"value":1230},{"type":606,"tag":644,"props":4331,"children":4332},{"style":650},[4333],{"type":612,"value":941},{"type":606,"tag":644,"props":4335,"children":4336},{"style":710},[4337],{"type":612,"value":4338},"\"Year must be between ",{"type":606,"tag":644,"props":4340,"children":4341},{"style":793},[4342],{"type":612,"value":951},{"type":606,"tag":644,"props":4344,"children":4345},{"style":656},[4346],{"type":612,"value":4347},"min_year",{"type":606,"tag":644,"props":4349,"children":4350},{"style":793},[4351],{"type":612,"value":961},{"type":606,"tag":644,"props":4353,"children":4354},{"style":710},[4355],{"type":612,"value":4356}," and ",{"type":606,"tag":644,"props":4358,"children":4359},{"style":793},[4360],{"type":612,"value":951},{"type":606,"tag":644,"props":4362,"children":4363},{"style":656},[4364],{"type":612,"value":4365},"max_year",{"type":606,"tag":644,"props":4367,"children":4368},{"style":793},[4369],{"type":612,"value":961},{"type":606,"tag":644,"props":4371,"children":4372},{"style":710},[4373],{"type":612,"value":4374},"\"\n",{"type":606,"tag":644,"props":4376,"children":4377},{"class":646,"line":217},[4378],{"type":606,"tag":644,"props":4379,"children":4380},{"style":656},[4381],{"type":612,"value":4112},{"type":606,"tag":644,"props":4383,"children":4384},{"class":646,"line":227},[4385],{"type":606,"tag":644,"props":4386,"children":4387},{"style":683},[4388],{"type":612,"value":4389},"        # Validate not in future (optional check)\n",{"type":606,"tag":644,"props":4391,"children":4392},{"class":646,"line":236},[4393,4397,4401,4406],{"type":606,"tag":644,"props":4394,"children":4395},{"style":650},[4396],{"type":612,"value":4224},{"type":606,"tag":644,"props":4398,"children":4399},{"style":656},[4400],{"type":612,"value":4229},{"type":606,"tag":644,"props":4402,"children":4403},{"style":650},[4404],{"type":612,"value":4405},">",{"type":606,"tag":644,"props":4407,"children":4408},{"style":656},[4409],{"type":612,"value":4410}," datetime.now():\n",{"type":606,"tag":644,"props":4412,"children":4413},{"class":646,"line":245},[4414,4418,4422,4426],{"type":606,"tag":644,"props":4415,"children":4416},{"style":650},[4417],{"type":612,"value":2749},{"type":606,"tag":644,"props":4419,"children":4420},{"style":793},[4421],{"type":612,"value":4239},{"type":606,"tag":644,"props":4423,"children":4424},{"style":656},[4425],{"type":612,"value":1230},{"type":606,"tag":644,"props":4427,"children":4428},{"style":710},[4429],{"type":612,"value":4430},"\"Date cannot be in the future\"\n",{"type":606,"tag":644,"props":4432,"children":4433},{"class":646,"line":254},[4434],{"type":606,"tag":644,"props":4435,"children":4436},{"style":656},[4437],{"type":612,"value":4112},{"type":606,"tag":644,"props":4439,"children":4440},{"class":646,"line":263},[4441,4446,4451],{"type":606,"tag":644,"props":4442,"children":4443},{"style":650},[4444],{"type":612,"value":4445},"        return",{"type":606,"tag":644,"props":4447,"children":4448},{"style":656},[4449],{"type":612,"value":4450}," parsed_date, ",{"type":606,"tag":644,"props":4452,"children":4453},{"style":710},[4454],{"type":612,"value":4455},"\"Valid\"\n",{"type":606,"tag":644,"props":4457,"children":4458},{"class":646,"line":272},[4459],{"type":606,"tag":644,"props":4460,"children":4461},{"style":656},[4462],{"type":612,"value":4112},{"type":606,"tag":644,"props":4464,"children":4465},{"class":646,"line":281},[4466,4470,4475,4479],{"type":606,"tag":644,"props":4467,"children":4468},{"style":650},[4469],{"type":612,"value":1900},{"type":606,"tag":644,"props":4471,"children":4472},{"style":793},[4473],{"type":612,"value":4474}," Exception",{"type":606,"tag":644,"props":4476,"children":4477},{"style":650},[4478],{"type":612,"value":1910},{"type":606,"tag":644,"props":4480,"children":4481},{"style":656},[4482],{"type":612,"value":1915},{"type":606,"tag":644,"props":4484,"children":4485},{"class":646,"line":291},[4486,4490,4494,4498,4502,4506,4511,4516,4520],{"type":606,"tag":644,"props":4487,"children":4488},{"style":650},[4489],{"type":612,"value":4445},{"type":606,"tag":644,"props":4491,"children":4492},{"style":793},[4493],{"type":612,"value":4239},{"type":606,"tag":644,"props":4495,"children":4496},{"style":656},[4497],{"type":612,"value":1230},{"type":606,"tag":644,"props":4499,"children":4500},{"style":650},[4501],{"type":612,"value":941},{"type":606,"tag":644,"props":4503,"children":4504},{"style":710},[4505],{"type":612,"value":2371},{"type":606,"tag":644,"props":4507,"children":4508},{"style":793},[4509],{"type":612,"value":4510},"{str",{"type":606,"tag":644,"props":4512,"children":4513},{"style":656},[4514],{"type":612,"value":4515},"(e)",{"type":606,"tag":644,"props":4517,"children":4518},{"style":793},[4519],{"type":612,"value":961},{"type":606,"tag":644,"props":4521,"children":4522},{"style":710},[4523],{"type":612,"value":4374},{"type":606,"tag":644,"props":4525,"children":4526},{"class":646,"line":302},[4527],{"type":606,"tag":644,"props":4528,"children":4529},{"emptyLinePlaceholder":13},[4530],{"type":612,"value":677},{"type":606,"tag":644,"props":4532,"children":4533},{"class":646,"line":311},[4534],{"type":606,"tag":644,"props":4535,"children":4536},{"style":683},[4537],{"type":612,"value":4538},"# Test date validation\n",{"type":606,"tag":644,"props":4540,"children":4541},{"class":646,"line":320},[4542,4546,4550],{"type":606,"tag":644,"props":4543,"children":4544},{"style":656},[4545],{"type":612,"value":2854},{"type":606,"tag":644,"props":4547,"children":4548},{"style":650},[4549],{"type":612,"value":699},{"type":606,"tag":644,"props":4551,"children":4552},{"style":656},[4553],{"type":612,"value":704},{"type":606,"tag":644,"props":4555,"children":4556},{"class":646,"line":329},[4557,4561,4566],{"type":606,"tag":644,"props":4558,"children":4559},{"style":710},[4560],{"type":612,"value":713},{"type":606,"tag":644,"props":4562,"children":4563},{"style":656},[4564],{"type":612,"value":4565},",      ",{"type":606,"tag":644,"props":4567,"children":4568},{"style":683},[4569],{"type":612,"value":4570},"# Valid\n",{"type":606,"tag":644,"props":4572,"children":4573},{"class":646,"line":338},[4574,4579,4583],{"type":606,"tag":644,"props":4575,"children":4576},{"style":710},[4577],{"type":612,"value":4578},"    \"13/15/2024\"",{"type":606,"tag":644,"props":4580,"children":4581},{"style":656},[4582],{"type":612,"value":4565},{"type":606,"tag":644,"props":4584,"children":4585},{"style":683},[4586],{"type":612,"value":4587},"# Invalid month\n",{"type":606,"tag":644,"props":4589,"children":4590},{"class":646,"line":347},[4591,4596,4600],{"type":606,"tag":644,"props":4592,"children":4593},{"style":710},[4594],{"type":612,"value":4595},"    \"2025-12-31\"",{"type":606,"tag":644,"props":4597,"children":4598},{"style":656},[4599],{"type":612,"value":4565},{"type":606,"tag":644,"props":4601,"children":4602},{"style":683},[4603],{"type":612,"value":4604},"# Future date\n",{"type":606,"tag":644,"props":4606,"children":4607},{"class":646,"line":356},[4608,4613,4617],{"type":606,"tag":644,"props":4609,"children":4610},{"style":710},[4611],{"type":612,"value":4612},"    \"1800-01-01\"",{"type":606,"tag":644,"props":4614,"children":4615},{"style":656},[4616],{"type":612,"value":4565},{"type":606,"tag":644,"props":4618,"children":4619},{"style":683},[4620],{"type":612,"value":4621},"# Too old\n",{"type":606,"tag":644,"props":4623,"children":4624},{"class":646,"line":367},[4625,4630,4634],{"type":606,"tag":644,"props":4626,"children":4627},{"style":710},[4628],{"type":612,"value":4629},"    \"invalid\"",{"type":606,"tag":644,"props":4631,"children":4632},{"style":656},[4633],{"type":612,"value":3467},{"type":606,"tag":644,"props":4635,"children":4636},{"style":683},[4637],{"type":612,"value":4638},"# Invalid format\n",{"type":606,"tag":644,"props":4640,"children":4641},{"class":646,"line":376},[4642],{"type":606,"tag":644,"props":4643,"children":4644},{"style":656},[4645],{"type":612,"value":759},{"type":606,"tag":644,"props":4647,"children":4648},{"class":646,"line":385},[4649],{"type":606,"tag":644,"props":4650,"children":4651},{"emptyLinePlaceholder":13},[4652],{"type":612,"value":677},{"type":606,"tag":644,"props":4654,"children":4655},{"class":646,"line":394},[4656,4660,4664,4668],{"type":606,"tag":644,"props":4657,"children":4658},{"style":650},[4659],{"type":612,"value":886},{"type":606,"tag":644,"props":4661,"children":4662},{"style":656},[4663],{"type":612,"value":2941},{"type":606,"tag":644,"props":4665,"children":4666},{"style":650},[4667],{"type":612,"value":896},{"type":606,"tag":644,"props":4669,"children":4670},{"style":656},[4671],{"type":612,"value":2950},{"type":606,"tag":644,"props":4673,"children":4674},{"class":646,"line":403},[4675,4680,4684],{"type":606,"tag":644,"props":4676,"children":4677},{"style":656},[4678],{"type":612,"value":4679},"    result, message ",{"type":606,"tag":644,"props":4681,"children":4682},{"style":650},[4683],{"type":612,"value":699},{"type":606,"tag":644,"props":4685,"children":4686},{"style":656},[4687],{"type":612,"value":4688}," validate_and_parse_date(date_str)\n",{"type":606,"tag":644,"props":4690,"children":4691},{"class":646,"line":412},[4692,4697,4701,4706,4711,4716,4721],{"type":606,"tag":644,"props":4693,"children":4694},{"style":656},[4695],{"type":612,"value":4696},"    status ",{"type":606,"tag":644,"props":4698,"children":4699},{"style":650},[4700],{"type":612,"value":699},{"type":606,"tag":644,"props":4702,"children":4703},{"style":710},[4704],{"type":612,"value":4705}," \"✓\"",{"type":606,"tag":644,"props":4707,"children":4708},{"style":650},[4709],{"type":612,"value":4710}," if",{"type":606,"tag":644,"props":4712,"children":4713},{"style":656},[4714],{"type":612,"value":4715}," result ",{"type":606,"tag":644,"props":4717,"children":4718},{"style":650},[4719],{"type":612,"value":4720},"else",{"type":606,"tag":644,"props":4722,"children":4723},{"style":710},[4724],{"type":612,"value":4725}," \"✗\"\n",{"type":606,"tag":644,"props":4727,"children":4728},{"class":646,"line":423},[4729,4733,4737,4741,4745,4749,4754,4758,4763,4767,4771,4775,4779,4783,4788,4792,4796],{"type":606,"tag":644,"props":4730,"children":4731},{"style":793},[4732],{"type":612,"value":931},{"type":606,"tag":644,"props":4734,"children":4735},{"style":656},[4736],{"type":612,"value":936},{"type":606,"tag":644,"props":4738,"children":4739},{"style":650},[4740],{"type":612,"value":941},{"type":606,"tag":644,"props":4742,"children":4743},{"style":710},[4744],{"type":612,"value":801},{"type":606,"tag":644,"props":4746,"children":4747},{"style":793},[4748],{"type":612,"value":951},{"type":606,"tag":644,"props":4750,"children":4751},{"style":656},[4752],{"type":612,"value":4753},"status",{"type":606,"tag":644,"props":4755,"children":4756},{"style":793},[4757],{"type":612,"value":961},{"type":606,"tag":644,"props":4759,"children":4760},{"style":710},[4761],{"type":612,"value":4762}," '",{"type":606,"tag":644,"props":4764,"children":4765},{"style":793},[4766],{"type":612,"value":951},{"type":606,"tag":644,"props":4768,"children":4769},{"style":656},[4770],{"type":612,"value":956},{"type":606,"tag":644,"props":4772,"children":4773},{"style":793},[4774],{"type":612,"value":961},{"type":606,"tag":644,"props":4776,"children":4777},{"style":710},[4778],{"type":612,"value":1952},{"type":606,"tag":644,"props":4780,"children":4781},{"style":793},[4782],{"type":612,"value":951},{"type":606,"tag":644,"props":4784,"children":4785},{"style":656},[4786],{"type":612,"value":4787},"message",{"type":606,"tag":644,"props":4789,"children":4790},{"style":793},[4791],{"type":612,"value":961},{"type":606,"tag":644,"props":4793,"children":4794},{"style":710},[4795],{"type":612,"value":801},{"type":606,"tag":644,"props":4797,"children":4798},{"style":656},[4799],{"type":612,"value":988},{"type":606,"tag":644,"props":4801,"children":4802},{"class":646,"line":432},[4803,4808],{"type":606,"tag":644,"props":4804,"children":4805},{"style":650},[4806],{"type":612,"value":4807},"    if",{"type":606,"tag":644,"props":4809,"children":4810},{"style":656},[4811],{"type":612,"value":4812}," result:\n",{"type":606,"tag":644,"props":4814,"children":4815},{"class":646,"line":441},[4816,4820,4824,4828,4833,4837,4842,4847,4851,4856,4860,4864,4868],{"type":606,"tag":644,"props":4817,"children":4818},{"style":793},[4819],{"type":612,"value":1842},{"type":606,"tag":644,"props":4821,"children":4822},{"style":656},[4823],{"type":612,"value":936},{"type":606,"tag":644,"props":4825,"children":4826},{"style":650},[4827],{"type":612,"value":941},{"type":606,"tag":644,"props":4829,"children":4830},{"style":710},[4831],{"type":612,"value":4832},"\"   Parsed as: ",{"type":606,"tag":644,"props":4834,"children":4835},{"style":793},[4836],{"type":612,"value":951},{"type":606,"tag":644,"props":4838,"children":4839},{"style":656},[4840],{"type":612,"value":4841},"result.strftime(",{"type":606,"tag":644,"props":4843,"children":4844},{"style":710},[4845],{"type":612,"value":4846},"'%B ",{"type":606,"tag":644,"props":4848,"children":4849},{"style":793},[4850],{"type":612,"value":796},{"type":606,"tag":644,"props":4852,"children":4853},{"style":710},[4854],{"type":612,"value":4855},", %Y'",{"type":606,"tag":644,"props":4857,"children":4858},{"style":656},[4859],{"type":612,"value":2320},{"type":606,"tag":644,"props":4861,"children":4862},{"style":793},[4863],{"type":612,"value":961},{"type":606,"tag":644,"props":4865,"children":4866},{"style":710},[4867],{"type":612,"value":801},{"type":606,"tag":644,"props":4869,"children":4870},{"style":656},[4871],{"type":612,"value":988},{"type":606,"tag":990,"props":4873,"children":4875},{"id":4874},"format-code-reference-for-parsing",[4876],{"type":612,"value":4877},"📊 Format Code Reference for Parsing",{"type":606,"tag":1155,"props":4879,"children":4881},{"id":4880},"essential-parse-formats",[4882],{"type":612,"value":4883},"Essential Parse Formats",{"type":606,"tag":4885,"props":4886,"children":4887},"table",{},[4888,4912],{"type":606,"tag":4889,"props":4890,"children":4891},"thead",{},[4892],{"type":606,"tag":4893,"props":4894,"children":4895},"tr",{},[4896,4902,4907],{"type":606,"tag":4897,"props":4898,"children":4899},"th",{},[4900],{"type":612,"value":4901},"Format",{"type":606,"tag":4897,"props":4903,"children":4904},{},[4905],{"type":612,"value":4906},"Pattern",{"type":606,"tag":4897,"props":4908,"children":4909},{},[4910],{"type":612,"value":4911},"Example Input",{"type":606,"tag":4913,"props":4914,"children":4915},"tbody",{},[4916,4943,4969,4995,5021,5047,5073],{"type":606,"tag":4893,"props":4917,"children":4918},{},[4919,4929,4934],{"type":606,"tag":4920,"props":4921,"children":4922},"td",{},[4923],{"type":606,"tag":621,"props":4924,"children":4926},{"className":4925},[],[4927],{"type":612,"value":4928},"%Y-%m-%d",{"type":606,"tag":4920,"props":4930,"children":4931},{},[4932],{"type":612,"value":4933},"ISO date",{"type":606,"tag":4920,"props":4935,"children":4936},{},[4937],{"type":606,"tag":621,"props":4938,"children":4940},{"className":4939},[],[4941],{"type":612,"value":4942},"2024-03-15",{"type":606,"tag":4893,"props":4944,"children":4945},{},[4946,4955,4960],{"type":606,"tag":4920,"props":4947,"children":4948},{},[4949],{"type":606,"tag":621,"props":4950,"children":4952},{"className":4951},[],[4953],{"type":612,"value":4954},"%m/%d/%Y",{"type":606,"tag":4920,"props":4956,"children":4957},{},[4958],{"type":612,"value":4959},"US date",{"type":606,"tag":4920,"props":4961,"children":4962},{},[4963],{"type":606,"tag":621,"props":4964,"children":4966},{"className":4965},[],[4967],{"type":612,"value":4968},"03/15/2024",{"type":606,"tag":4893,"props":4970,"children":4971},{},[4972,4981,4986],{"type":606,"tag":4920,"props":4973,"children":4974},{},[4975],{"type":606,"tag":621,"props":4976,"children":4978},{"className":4977},[],[4979],{"type":612,"value":4980},"%d/%m/%Y",{"type":606,"tag":4920,"props":4982,"children":4983},{},[4984],{"type":612,"value":4985},"European date",{"type":606,"tag":4920,"props":4987,"children":4988},{},[4989],{"type":606,"tag":621,"props":4990,"children":4992},{"className":4991},[],[4993],{"type":612,"value":4994},"15/03/2024",{"type":606,"tag":4893,"props":4996,"children":4997},{},[4998,5007,5012],{"type":606,"tag":4920,"props":4999,"children":5000},{},[5001],{"type":606,"tag":621,"props":5002,"children":5004},{"className":5003},[],[5005],{"type":612,"value":5006},"%B %d, %Y",{"type":606,"tag":4920,"props":5008,"children":5009},{},[5010],{"type":612,"value":5011},"Full month",{"type":606,"tag":4920,"props":5013,"children":5014},{},[5015],{"type":606,"tag":621,"props":5016,"children":5018},{"className":5017},[],[5019],{"type":612,"value":5020},"March 15, 2024",{"type":606,"tag":4893,"props":5022,"children":5023},{},[5024,5033,5038],{"type":606,"tag":4920,"props":5025,"children":5026},{},[5027],{"type":606,"tag":621,"props":5028,"children":5030},{"className":5029},[],[5031],{"type":612,"value":5032},"%b %d, %Y",{"type":606,"tag":4920,"props":5034,"children":5035},{},[5036],{"type":612,"value":5037},"Short month",{"type":606,"tag":4920,"props":5039,"children":5040},{},[5041],{"type":606,"tag":621,"props":5042,"children":5044},{"className":5043},[],[5045],{"type":612,"value":5046},"Mar 15, 2024",{"type":606,"tag":4893,"props":5048,"children":5049},{},[5050,5059,5064],{"type":606,"tag":4920,"props":5051,"children":5052},{},[5053],{"type":606,"tag":621,"props":5054,"children":5056},{"className":5055},[],[5057],{"type":612,"value":5058},"%Y-%m-%d %H:%M:%S",{"type":606,"tag":4920,"props":5060,"children":5061},{},[5062],{"type":612,"value":5063},"ISO datetime",{"type":606,"tag":4920,"props":5065,"children":5066},{},[5067],{"type":606,"tag":621,"props":5068,"children":5070},{"className":5069},[],[5071],{"type":612,"value":5072},"2024-03-15 14:30:45",{"type":606,"tag":4893,"props":5074,"children":5075},{},[5076,5085,5090],{"type":606,"tag":4920,"props":5077,"children":5078},{},[5079],{"type":606,"tag":621,"props":5080,"children":5082},{"className":5081},[],[5083],{"type":612,"value":5084},"%m/%d/%Y %I:%M %p",{"type":606,"tag":4920,"props":5086,"children":5087},{},[5088],{"type":612,"value":5089},"US datetime",{"type":606,"tag":4920,"props":5091,"children":5092},{},[5093],{"type":606,"tag":621,"props":5094,"children":5096},{"className":5095},[],[5097],{"type":612,"value":5098},"03/15/2024 2:30 PM",{"type":606,"tag":1155,"props":5100,"children":5102},{"id":5101},"time-zone-parsing",[5103],{"type":612,"value":5104},"Time Zone Parsing",{"type":606,"tag":630,"props":5106,"children":5107},{},[5108],{"type":606,"tag":634,"props":5109,"children":5111},{"className":636,"code":5110,"language":638,"meta":8,"style":8},"from datetime import datetime\n\n# Parsing dates with timezone info (basic)\ndef parse_with_timezone_info(date_string):\n    \"\"\"Parse dates that might contain timezone info\"\"\"\n    # Remove common timezone indicators for basic parsing\n    cleaned = date_string\n    tz_patterns = [' UTC', ' GMT', ' EST', ' PST', ' CST', ' MST']\n    \n    for pattern in tz_patterns:\n        if pattern in cleaned:\n            cleaned = cleaned.replace(pattern, '')\n            print(f\"Removed timezone: {pattern.strip()}\")\n    \n    # Parse the cleaned datetime\n    try:\n        return datetime.strptime(cleaned, \"%Y-%m-%d %H:%M:%S\")\n    except ValueError:\n        return datetime.strptime(cleaned, \"%m/%d/%Y %H:%M:%S\")\n\n# Example usage\ntz_dates = [\n    \"2024-03-15 14:30:45 UTC\",\n    \"03/15/2024 14:30:45 EST\"\n]\n\nfor date_str in tz_dates:\n    try:\n        parsed = parse_with_timezone_info(date_str)\n        print(f\"'{date_str}' → {parsed}\")\n    except ValueError as e:\n        print(f\"Error: {e}\")\n",[5112],{"type":606,"tag":621,"props":5113,"children":5114},{"__ignoreMap":8},[5115,5134,5141,5149,5165,5173,5181,5197,5267,5274,5295,5315,5340,5382,5389,5397,5408,5436,5451,5479,5486,5494,5510,5522,5530,5537,5544,5564,5575,5591,5646,5665],{"type":606,"tag":644,"props":5116,"children":5117},{"class":646,"line":12},[5118,5122,5126,5130],{"type":606,"tag":644,"props":5119,"children":5120},{"style":650},[5121],{"type":612,"value":653},{"type":606,"tag":644,"props":5123,"children":5124},{"style":656},[5125],{"type":612,"value":659},{"type":606,"tag":644,"props":5127,"children":5128},{"style":650},[5129],{"type":612,"value":664},{"type":606,"tag":644,"props":5131,"children":5132},{"style":656},[5133],{"type":612,"value":669},{"type":606,"tag":644,"props":5135,"children":5136},{"class":646,"line":27},[5137],{"type":606,"tag":644,"props":5138,"children":5139},{"emptyLinePlaceholder":13},[5140],{"type":612,"value":677},{"type":606,"tag":644,"props":5142,"children":5143},{"class":646,"line":36},[5144],{"type":606,"tag":644,"props":5145,"children":5146},{"style":683},[5147],{"type":612,"value":5148},"# Parsing dates with timezone info (basic)\n",{"type":606,"tag":644,"props":5150,"children":5151},{"class":646,"line":45},[5152,5156,5161],{"type":606,"tag":644,"props":5153,"children":5154},{"style":650},[5155],{"type":612,"value":2452},{"type":606,"tag":644,"props":5157,"children":5158},{"style":2455},[5159],{"type":612,"value":5160}," parse_with_timezone_info",{"type":606,"tag":644,"props":5162,"children":5163},{"style":656},[5164],{"type":612,"value":2463},{"type":606,"tag":644,"props":5166,"children":5167},{"class":646,"line":54},[5168],{"type":606,"tag":644,"props":5169,"children":5170},{"style":710},[5171],{"type":612,"value":5172},"    \"\"\"Parse dates that might contain timezone info\"\"\"\n",{"type":606,"tag":644,"props":5174,"children":5175},{"class":646,"line":63},[5176],{"type":606,"tag":644,"props":5177,"children":5178},{"style":683},[5179],{"type":612,"value":5180},"    # Remove common timezone indicators for basic parsing\n",{"type":606,"tag":644,"props":5182,"children":5183},{"class":646,"line":72},[5184,5188,5192],{"type":606,"tag":644,"props":5185,"children":5186},{"style":656},[5187],{"type":612,"value":3186},{"type":606,"tag":644,"props":5189,"children":5190},{"style":650},[5191],{"type":612,"value":699},{"type":606,"tag":644,"props":5193,"children":5194},{"style":656},[5195],{"type":612,"value":5196}," date_string\n",{"type":606,"tag":644,"props":5198,"children":5199},{"class":646,"line":81},[5200,5205,5209,5213,5218,5222,5227,5231,5236,5240,5245,5249,5254,5258,5263],{"type":606,"tag":644,"props":5201,"children":5202},{"style":656},[5203],{"type":612,"value":5204},"    tz_patterns ",{"type":606,"tag":644,"props":5206,"children":5207},{"style":650},[5208],{"type":612,"value":699},{"type":606,"tag":644,"props":5210,"children":5211},{"style":656},[5212],{"type":612,"value":4040},{"type":606,"tag":644,"props":5214,"children":5215},{"style":710},[5216],{"type":612,"value":5217},"' UTC'",{"type":606,"tag":644,"props":5219,"children":5220},{"style":656},[5221],{"type":612,"value":1230},{"type":606,"tag":644,"props":5223,"children":5224},{"style":710},[5225],{"type":612,"value":5226},"' GMT'",{"type":606,"tag":644,"props":5228,"children":5229},{"style":656},[5230],{"type":612,"value":1230},{"type":606,"tag":644,"props":5232,"children":5233},{"style":710},[5234],{"type":612,"value":5235},"' EST'",{"type":606,"tag":644,"props":5237,"children":5238},{"style":656},[5239],{"type":612,"value":1230},{"type":606,"tag":644,"props":5241,"children":5242},{"style":710},[5243],{"type":612,"value":5244},"' PST'",{"type":606,"tag":644,"props":5246,"children":5247},{"style":656},[5248],{"type":612,"value":1230},{"type":606,"tag":644,"props":5250,"children":5251},{"style":710},[5252],{"type":612,"value":5253},"' CST'",{"type":606,"tag":644,"props":5255,"children":5256},{"style":656},[5257],{"type":612,"value":1230},{"type":606,"tag":644,"props":5259,"children":5260},{"style":710},[5261],{"type":612,"value":5262},"' MST'",{"type":606,"tag":644,"props":5264,"children":5265},{"style":656},[5266],{"type":612,"value":759},{"type":606,"tag":644,"props":5268,"children":5269},{"class":646,"line":753},[5270],{"type":606,"tag":644,"props":5271,"children":5272},{"style":656},[5273],{"type":612,"value":2707},{"type":606,"tag":644,"props":5275,"children":5276},{"class":646,"line":99},[5277,5281,5286,5290],{"type":606,"tag":644,"props":5278,"children":5279},{"style":650},[5280],{"type":612,"value":2715},{"type":606,"tag":644,"props":5282,"children":5283},{"style":656},[5284],{"type":612,"value":5285}," pattern ",{"type":606,"tag":644,"props":5287,"children":5288},{"style":650},[5289],{"type":612,"value":896},{"type":606,"tag":644,"props":5291,"children":5292},{"style":656},[5293],{"type":612,"value":5294}," tz_patterns:\n",{"type":606,"tag":644,"props":5296,"children":5297},{"class":646,"line":108},[5298,5302,5306,5310],{"type":606,"tag":644,"props":5299,"children":5300},{"style":650},[5301],{"type":612,"value":4224},{"type":606,"tag":644,"props":5303,"children":5304},{"style":656},[5305],{"type":612,"value":5285},{"type":606,"tag":644,"props":5307,"children":5308},{"style":650},[5309],{"type":612,"value":896},{"type":606,"tag":644,"props":5311,"children":5312},{"style":656},[5313],{"type":612,"value":5314}," cleaned:\n",{"type":606,"tag":644,"props":5316,"children":5317},{"class":646,"line":117},[5318,5323,5327,5332,5336],{"type":606,"tag":644,"props":5319,"children":5320},{"style":656},[5321],{"type":612,"value":5322},"            cleaned ",{"type":606,"tag":644,"props":5324,"children":5325},{"style":650},[5326],{"type":612,"value":699},{"type":606,"tag":644,"props":5328,"children":5329},{"style":656},[5330],{"type":612,"value":5331}," cleaned.replace(pattern, ",{"type":606,"tag":644,"props":5333,"children":5334},{"style":710},[5335],{"type":612,"value":3252},{"type":606,"tag":644,"props":5337,"children":5338},{"style":656},[5339],{"type":612,"value":988},{"type":606,"tag":644,"props":5341,"children":5342},{"class":646,"line":126},[5343,5348,5352,5356,5361,5365,5370,5374,5378],{"type":606,"tag":644,"props":5344,"children":5345},{"style":793},[5346],{"type":612,"value":5347},"            print",{"type":606,"tag":644,"props":5349,"children":5350},{"style":656},[5351],{"type":612,"value":936},{"type":606,"tag":644,"props":5353,"children":5354},{"style":650},[5355],{"type":612,"value":941},{"type":606,"tag":644,"props":5357,"children":5358},{"style":710},[5359],{"type":612,"value":5360},"\"Removed timezone: ",{"type":606,"tag":644,"props":5362,"children":5363},{"style":793},[5364],{"type":612,"value":951},{"type":606,"tag":644,"props":5366,"children":5367},{"style":656},[5368],{"type":612,"value":5369},"pattern.strip()",{"type":606,"tag":644,"props":5371,"children":5372},{"style":793},[5373],{"type":612,"value":961},{"type":606,"tag":644,"props":5375,"children":5376},{"style":710},[5377],{"type":612,"value":801},{"type":606,"tag":644,"props":5379,"children":5380},{"style":656},[5381],{"type":612,"value":988},{"type":606,"tag":644,"props":5383,"children":5384},{"class":646,"line":135},[5385],{"type":606,"tag":644,"props":5386,"children":5387},{"style":656},[5388],{"type":612,"value":2707},{"type":606,"tag":644,"props":5390,"children":5391},{"class":646,"line":144},[5392],{"type":606,"tag":644,"props":5393,"children":5394},{"style":683},[5395],{"type":612,"value":5396},"    # Parse the cleaned datetime\n",{"type":606,"tag":644,"props":5398,"children":5399},{"class":646,"line":153},[5400,5404],{"type":606,"tag":644,"props":5401,"children":5402},{"style":650},[5403],{"type":612,"value":1804},{"type":606,"tag":644,"props":5405,"children":5406},{"style":656},[5407],{"type":612,"value":1809},{"type":606,"tag":644,"props":5409,"children":5410},{"class":646,"line":163},[5411,5415,5420,5424,5428,5432],{"type":606,"tag":644,"props":5412,"children":5413},{"style":650},[5414],{"type":612,"value":4445},{"type":606,"tag":644,"props":5416,"children":5417},{"style":656},[5418],{"type":612,"value":5419}," datetime.strptime(cleaned, ",{"type":606,"tag":644,"props":5421,"children":5422},{"style":710},[5423],{"type":612,"value":1235},{"type":606,"tag":644,"props":5425,"children":5426},{"style":793},[5427],{"type":612,"value":796},{"type":606,"tag":644,"props":5429,"children":5430},{"style":710},[5431],{"type":612,"value":1525},{"type":606,"tag":644,"props":5433,"children":5434},{"style":656},[5435],{"type":612,"value":988},{"type":606,"tag":644,"props":5437,"children":5438},{"class":646,"line":172},[5439,5443,5447],{"type":606,"tag":644,"props":5440,"children":5441},{"style":650},[5442],{"type":612,"value":1900},{"type":606,"tag":644,"props":5444,"children":5445},{"style":793},[5446],{"type":612,"value":1905},{"type":606,"tag":644,"props":5448,"children":5449},{"style":656},[5450],{"type":612,"value":1809},{"type":606,"tag":644,"props":5452,"children":5453},{"class":646,"line":181},[5454,5458,5462,5466,5470,5475],{"type":606,"tag":644,"props":5455,"children":5456},{"style":650},[5457],{"type":612,"value":4445},{"type":606,"tag":644,"props":5459,"children":5460},{"style":656},[5461],{"type":612,"value":5419},{"type":606,"tag":644,"props":5463,"children":5464},{"style":710},[5465],{"type":612,"value":1277},{"type":606,"tag":644,"props":5467,"children":5468},{"style":793},[5469],{"type":612,"value":796},{"type":606,"tag":644,"props":5471,"children":5472},{"style":710},[5473],{"type":612,"value":5474},"/%Y %H:%M:%S\"",{"type":606,"tag":644,"props":5476,"children":5477},{"style":656},[5478],{"type":612,"value":988},{"type":606,"tag":644,"props":5480,"children":5481},{"class":646,"line":190},[5482],{"type":606,"tag":644,"props":5483,"children":5484},{"emptyLinePlaceholder":13},[5485],{"type":612,"value":677},{"type":606,"tag":644,"props":5487,"children":5488},{"class":646,"line":199},[5489],{"type":606,"tag":644,"props":5490,"children":5491},{"style":683},[5492],{"type":612,"value":5493},"# Example usage\n",{"type":606,"tag":644,"props":5495,"children":5496},{"class":646,"line":208},[5497,5502,5506],{"type":606,"tag":644,"props":5498,"children":5499},{"style":656},[5500],{"type":612,"value":5501},"tz_dates ",{"type":606,"tag":644,"props":5503,"children":5504},{"style":650},[5505],{"type":612,"value":699},{"type":606,"tag":644,"props":5507,"children":5508},{"style":656},[5509],{"type":612,"value":704},{"type":606,"tag":644,"props":5511,"children":5512},{"class":646,"line":217},[5513,5518],{"type":606,"tag":644,"props":5514,"children":5515},{"style":710},[5516],{"type":612,"value":5517},"    \"2024-03-15 14:30:45 UTC\"",{"type":606,"tag":644,"props":5519,"children":5520},{"style":656},[5521],{"type":612,"value":718},{"type":606,"tag":644,"props":5523,"children":5524},{"class":646,"line":227},[5525],{"type":606,"tag":644,"props":5526,"children":5527},{"style":710},[5528],{"type":612,"value":5529},"    \"03/15/2024 14:30:45 EST\"\n",{"type":606,"tag":644,"props":5531,"children":5532},{"class":646,"line":236},[5533],{"type":606,"tag":644,"props":5534,"children":5535},{"style":656},[5536],{"type":612,"value":759},{"type":606,"tag":644,"props":5538,"children":5539},{"class":646,"line":245},[5540],{"type":606,"tag":644,"props":5541,"children":5542},{"emptyLinePlaceholder":13},[5543],{"type":612,"value":677},{"type":606,"tag":644,"props":5545,"children":5546},{"class":646,"line":254},[5547,5551,5555,5559],{"type":606,"tag":644,"props":5548,"children":5549},{"style":650},[5550],{"type":612,"value":886},{"type":606,"tag":644,"props":5552,"children":5553},{"style":656},[5554],{"type":612,"value":2941},{"type":606,"tag":644,"props":5556,"children":5557},{"style":650},[5558],{"type":612,"value":896},{"type":606,"tag":644,"props":5560,"children":5561},{"style":656},[5562],{"type":612,"value":5563}," tz_dates:\n",{"type":606,"tag":644,"props":5565,"children":5566},{"class":646,"line":263},[5567,5571],{"type":606,"tag":644,"props":5568,"children":5569},{"style":650},[5570],{"type":612,"value":1804},{"type":606,"tag":644,"props":5572,"children":5573},{"style":656},[5574],{"type":612,"value":1809},{"type":606,"tag":644,"props":5576,"children":5577},{"class":646,"line":272},[5578,5582,5586],{"type":606,"tag":644,"props":5579,"children":5580},{"style":656},[5581],{"type":612,"value":1825},{"type":606,"tag":644,"props":5583,"children":5584},{"style":650},[5585],{"type":612,"value":699},{"type":606,"tag":644,"props":5587,"children":5588},{"style":656},[5589],{"type":612,"value":5590}," parse_with_timezone_info(date_str)\n",{"type":606,"tag":644,"props":5592,"children":5593},{"class":646,"line":281},[5594,5598,5602,5606,5610,5614,5618,5622,5626,5630,5634,5638,5642],{"type":606,"tag":644,"props":5595,"children":5596},{"style":793},[5597],{"type":612,"value":1842},{"type":606,"tag":644,"props":5599,"children":5600},{"style":656},[5601],{"type":612,"value":936},{"type":606,"tag":644,"props":5603,"children":5604},{"style":650},[5605],{"type":612,"value":941},{"type":606,"tag":644,"props":5607,"children":5608},{"style":710},[5609],{"type":612,"value":946},{"type":606,"tag":644,"props":5611,"children":5612},{"style":793},[5613],{"type":612,"value":951},{"type":606,"tag":644,"props":5615,"children":5616},{"style":656},[5617],{"type":612,"value":956},{"type":606,"tag":644,"props":5619,"children":5620},{"style":793},[5621],{"type":612,"value":961},{"type":606,"tag":644,"props":5623,"children":5624},{"style":710},[5625],{"type":612,"value":966},{"type":606,"tag":644,"props":5627,"children":5628},{"style":793},[5629],{"type":612,"value":951},{"type":606,"tag":644,"props":5631,"children":5632},{"style":656},[5633],{"type":612,"value":975},{"type":606,"tag":644,"props":5635,"children":5636},{"style":793},[5637],{"type":612,"value":961},{"type":606,"tag":644,"props":5639,"children":5640},{"style":710},[5641],{"type":612,"value":801},{"type":606,"tag":644,"props":5643,"children":5644},{"style":656},[5645],{"type":612,"value":988},{"type":606,"tag":644,"props":5647,"children":5648},{"class":646,"line":291},[5649,5653,5657,5661],{"type":606,"tag":644,"props":5650,"children":5651},{"style":650},[5652],{"type":612,"value":1900},{"type":606,"tag":644,"props":5654,"children":5655},{"style":793},[5656],{"type":612,"value":1905},{"type":606,"tag":644,"props":5658,"children":5659},{"style":650},[5660],{"type":612,"value":1910},{"type":606,"tag":644,"props":5662,"children":5663},{"style":656},[5664],{"type":612,"value":1915},{"type":606,"tag":644,"props":5666,"children":5667},{"class":646,"line":302},[5668,5672,5676,5680,5684,5688,5692,5696,5700],{"type":606,"tag":644,"props":5669,"children":5670},{"style":793},[5671],{"type":612,"value":1842},{"type":606,"tag":644,"props":5673,"children":5674},{"style":656},[5675],{"type":612,"value":936},{"type":606,"tag":644,"props":5677,"children":5678},{"style":650},[5679],{"type":612,"value":941},{"type":606,"tag":644,"props":5681,"children":5682},{"style":710},[5683],{"type":612,"value":2371},{"type":606,"tag":644,"props":5685,"children":5686},{"style":793},[5687],{"type":612,"value":951},{"type":606,"tag":644,"props":5689,"children":5690},{"style":656},[5691],{"type":612,"value":1961},{"type":606,"tag":644,"props":5693,"children":5694},{"style":793},[5695],{"type":612,"value":961},{"type":606,"tag":644,"props":5697,"children":5698},{"style":710},[5699],{"type":612,"value":801},{"type":606,"tag":644,"props":5701,"children":5702},{"style":656},[5703],{"type":612,"value":988},{"type":606,"tag":990,"props":5705,"children":5707},{"id":5706},"key-takeaways",[5708],{"type":612,"value":5709},"🎯 Key Takeaways",{"type":606,"tag":1009,"props":5711,"children":5715},{"emoji":5712,"title":5713,"type":5714},"📚","Date Parsing Essentials","success",[5716,5724,5752,5760,5783,5791,5834,5842,5865],{"type":606,"tag":615,"props":5717,"children":5718},{},[5719],{"type":606,"tag":1019,"props":5720,"children":5721},{},[5722],{"type":612,"value":5723},"Core Method:",{"type":606,"tag":1026,"props":5725,"children":5726},{},[5727,5737,5747],{"type":606,"tag":1030,"props":5728,"children":5729},{},[5730,5735],{"type":606,"tag":621,"props":5731,"children":5733},{"className":5732},[],[5734],{"type":612,"value":626},{"type":612,"value":5736},": String → datetime object",{"type":606,"tag":1030,"props":5738,"children":5739},{},[5740,5742],{"type":612,"value":5741},"Uses same format codes as ",{"type":606,"tag":621,"props":5743,"children":5745},{"className":5744},[],[5746],{"type":612,"value":1078},{"type":606,"tag":1030,"props":5748,"children":5749},{},[5750],{"type":612,"value":5751},"Exact format match required",{"type":606,"tag":615,"props":5753,"children":5754},{},[5755],{"type":606,"tag":1019,"props":5756,"children":5757},{},[5758],{"type":612,"value":5759},"Best Practices:",{"type":606,"tag":1026,"props":5761,"children":5762},{},[5763,5768,5773,5778],{"type":606,"tag":1030,"props":5764,"children":5765},{},[5766],{"type":612,"value":5767},"Try multiple formats for flexibility",{"type":606,"tag":1030,"props":5769,"children":5770},{},[5771],{"type":612,"value":5772},"Validate parsed dates for reasonableness",{"type":606,"tag":1030,"props":5774,"children":5775},{},[5776],{"type":612,"value":5777},"Clean input strings before parsing",{"type":606,"tag":1030,"props":5779,"children":5780},{},[5781],{"type":612,"value":5782},"Handle errors gracefully",{"type":606,"tag":615,"props":5784,"children":5785},{},[5786],{"type":606,"tag":1019,"props":5787,"children":5788},{},[5789],{"type":612,"value":5790},"Common Patterns:",{"type":606,"tag":1026,"props":5792,"children":5793},{},[5794,5804,5814,5824],{"type":606,"tag":1030,"props":5795,"children":5796},{},[5797,5799],{"type":612,"value":5798},"ISO: ",{"type":606,"tag":621,"props":5800,"children":5802},{"className":5801},[],[5803],{"type":612,"value":4928},{"type":606,"tag":1030,"props":5805,"children":5806},{},[5807,5809],{"type":612,"value":5808},"US: ",{"type":606,"tag":621,"props":5810,"children":5812},{"className":5811},[],[5813],{"type":612,"value":4954},{"type":606,"tag":1030,"props":5815,"children":5816},{},[5817,5819],{"type":612,"value":5818},"European: ",{"type":606,"tag":621,"props":5820,"children":5822},{"className":5821},[],[5823],{"type":612,"value":4980},{"type":606,"tag":1030,"props":5825,"children":5826},{},[5827,5829],{"type":612,"value":5828},"Named months: ",{"type":606,"tag":621,"props":5830,"children":5832},{"className":5831},[],[5833],{"type":612,"value":5006},{"type":606,"tag":615,"props":5835,"children":5836},{},[5837],{"type":606,"tag":1019,"props":5838,"children":5839},{},[5840],{"type":612,"value":5841},"Error Handling:",{"type":606,"tag":1026,"props":5843,"children":5844},{},[5845,5855,5860],{"type":606,"tag":1030,"props":5846,"children":5847},{},[5848,5850],{"type":612,"value":5849},"Always use try/except with ",{"type":606,"tag":621,"props":5851,"children":5853},{"className":5852},[],[5854],{"type":612,"value":626},{"type":606,"tag":1030,"props":5856,"children":5857},{},[5858],{"type":612,"value":5859},"Provide helpful error messages",{"type":606,"tag":1030,"props":5861,"children":5862},{},[5863],{"type":612,"value":5864},"Validate date ranges when needed",{"type":606,"tag":615,"props":5866,"children":5867},{},[5868,5873],{"type":606,"tag":1019,"props":5869,"children":5870},{},[5871],{"type":612,"value":5872},"Remember:",{"type":612,"value":5874}," Parsing requires exact format matches - be flexible in your approach!",{"type":606,"tag":990,"props":5876,"children":5878},{"id":5877},"whats-next",[5879],{"type":612,"value":5880},"🚀 What's Next?",{"type":606,"tag":615,"props":5882,"children":5883},{},[5884],{"type":612,"value":5885},"Now that you can parse date strings, learn how to handle time zones for global applications.",{"type":606,"tag":615,"props":5887,"children":5888},{},[5889,5894,5895],{"type":606,"tag":1019,"props":5890,"children":5891},{},[5892],{"type":612,"value":5893},"Continue to",{"type":612,"value":1129},{"type":606,"tag":5896,"props":5897,"children":5898},"a",{"href":334},[5899],{"type":612,"value":335},{"type":606,"tag":5901,"props":5902,"children":5903},"style",{},[5904],{"type":612,"value":5905},"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":5907},[5908,5913,5918,5922,5923],{"id":992,"depth":27,"text":995,"children":5909},[5910,5911,5912],{"id":1157,"depth":36,"text":1160},{"id":1573,"depth":36,"text":1576},{"id":1976,"depth":36,"text":1979},{"id":2394,"depth":27,"text":2397,"children":5914},[5915,5916,5917],{"id":2405,"depth":36,"text":2408},{"id":3095,"depth":36,"text":3098},{"id":3912,"depth":36,"text":3915},{"id":4874,"depth":27,"text":4877,"children":5919},[5920,5921],{"id":4880,"depth":36,"text":4883},{"id":5101,"depth":36,"text":5104},{"id":5706,"depth":27,"text":5709},{"id":5877,"depth":27,"text":5880},1782373758586]