format_time
format_time(time: timestamp, format: const string, [timezone: string]?) -> string
Format a timestamp column according to the specified format string.
Format specifiers are detailed in Snowflake's time format specifiers documentation
format_time can be used to extract elements of a time, such as the year or hour.
The optional timezone argument can be a time zone name or a link name from release 2021a of the IANA Time Zone Database (for example, America/Los_Angeles, Europe/London, UTC, Etc/GMT). Note that we do not support major timezone abbreviations (ex: PDT, EST, etc) because this can refer to several different time zones.
If the timezone argument is not supplied, the timestamp will be interpreted as UTC.
Domain
This is a scalar function (calculates a single output value for a single input row).
Categories
Examples
Extracts the year from the "Valid From" column
Format the "Valid From" column according to ISO 8601
Format the "Valid From" column similar to ctime's format
Format the "Valid From" column using US's date format and a 12-hour clock.
Format the "Valid From" column according to ISO 8601, in the America/Los_Angeles timezone.