To Timestamp
Data Type Formatting Function
Description
Converts a string to a timestamp according to the given format.
Click here to navigate to the PostgreSQL docs page for this syntax.
The function TO_TIMESTAMP()
is supported on Snowflake, but some formats may fail or behave differently in Snowflake.
Grammar Syntax
Sample Source Patterns
PostgreSQL
Snowflake
And the following cases are fully supported in Snowflake.
PostgreSQL
Snowflake
Snowflake supports the following formats:
Format Element | Description |
---|---|
YYYY | Year (4 or more digits). |
YY | Last 2 digits of year. |
MM | Month number (01–12). |
MON | Month name (3 chars in English, localized lengths vary). |
DD | Day of month (01–31). |
DY | Day name (3 chars in English, localized lengths vary). |
HH24 | Hour of day (01–12). |
HH12 | Hour of day (00–23). |
FF{x} | Seconds with {x} precision between 1-9 |
Related EWIs
Last updated