Date
The Date function is used for manipulating dates and times. It receives a text string as input and returns it as a date object using the format 'mm/dd/yyyy hh:mm:ss tt', representing month/day/year, and time in a 12-hour clock format. The function also includes robust error handling, returning NULL for non-string inputs or when encountering parsing issues. This ensures reliable and predictable behavior even with unexpected input. If no date is provided, it defaults to returning the current time with the current date.
Syntax
Date(text string)
Example
Date("08/24/2023 16:22:53") -> returns '08/24/2023 4:22:53 PM'
Date("2023-08-24T04 :22 :53.53") -> returns '08/24/2023 4:22:53 AM'
Date("2023-08-25T00 :00 :00") -> returns '08/25/2023 12:00:00 AM'
Date("Monday, 24 August 2023") -> returns '08/24/2023 12:00:00 AM'
Date("08/24/2023") -> returns '08/24/2023 12:00:00 AM'
Date("16 :33 :44") -> returns '08/24/2023 4:33:44 PM'