Key Features:
- Returns only the date part (year, month, day)
- Time is always set to 00:00:00
- Supports multiple international formats
- Handles timezones and AM/PM formats
Supported Formats
The function handles these date format categories:Standard Date Formats
DD/MM/YYYY: “22/11/2024”, “13/12/2024”MM/DD/YYYY: “01/17/2025”, “10/25/2024”- Single-digit variants: “8/16/2019”, “9/28/2024”
Date-Time Combinations
- With 24-hour time: “22/11/2024 21:19:05”
- With AM/PM: “12/09/2024 9:00 AM”
- With dash separator: “12/19/2024 - 2:00 PM”
Timezone Support
- With timezone abbreviations: “10/23/2024 12:06 PM CST”
- With timezone offset: “01/17/2025 3:00:00 PM CT”
Text Month Formats
- Short month: “5 Dec 2024”, “11 Sep 2024”
- With time: “5 Dec 2024 8:00 AM PST”
- Full month: “November 14, 2024”, “January 31, 2025, 5:00 pm”
Examples
Arguments
A string containing a date in various possible formats
Returns: datetime | None
Returns a datetime object with:
- Only date components preserved (year, month, day)
- Time always set to 00:00:00
Noneif parsing fails