This function is used to convert a timestamp in a given time zone to a UTC timestamp.
to_utc_timestamp(string timestamp, string timezone)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
timestamp |
Yes |
DATE STRING TINYINT SMALLINT INT BIGINT |
Time to be processed Date value of the DATE or STRING type, or timestamp of the TINYINT, SMALLINT, INT, or BIGINT type. The following formats are supported:
|
timezone |
Yes |
STRING |
Time zone where the time to be converted belongs |
The return value is of the BIGINT type.
The value 1692028800000 is returned.
select to_utc_timestamp('2023-08-14 17:00:00','PST');
The value NULL is returned.
select to_utc_timestamp(null);