DATE_PARSE
All functions > DATE_AND_TIME > DATE_PARSE
Returns a timestamp from the given string and format.
Syntax
DATE_PARSE(string, format)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
string | VARCHAR | Yes | The date/time string to parse |
format | VARCHAR | Yes | The format string matching the input (e.g., '%Y-%m-%d') |
Returns
A TIMESTAMP value parsed from the string
Notes
- Parses date/time string according to the specified format
- Format uses strftime-style placeholders matching the input
- Returns NULL if the string doesn't match the format
- Inverse of DATE_FORMAT
- Useful for parsing custom date formats from external sources