DATE_PARSE
All functions > DATE AND TIME > DATE_PARSE
Returns a timestamp from the given string and format.
Signatures
Returns: A TIMESTAMP value parsed from the string
DATE_PARSE(string: VARCHAR, format: VARCHAR) → TIMESTAMP sql
| 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') |
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
Examples
FeatureQL
SELECT
f1 := DATE_PARSE('2024-03-15', '%Y-%m-%d'), -- Parse date string
f2 := DATE_PARSE('15/03/2024 10:30', '%d/%m/%Y %H:%M') -- Parse custom format
;Result
| f1 TIMESTAMP | f2 TIMESTAMP |
|---|---|
| 2024-03-15T00:00:00 | 2024-03-15T10:30:00 |
On this page