to_utc_timestamp
The to_utc_timestamp function is used to convert a timestamp corresponding to the specified timezone to a UTC timestamp.
Syntax
to_utc_timestamp(string timestamp, string timezone)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| timestamp | Yes | DATE, TIMESTAMP, or STRING | The timestamp to be converted Formats: yyyy-MM-dd yyyy-MM-dd HH:mm:ss yyyy-MM-dd HH:mm:ss.SSS |
| timezone | Yes | STRING | The target time zone for conversion. |
Return Values
Returns a value of type BIGINT.
- If timestamp is not of type DATE or STRING, an error is returned with the message "data type mismatch".
- If timestamp is of type DATE or STRING but does not conform to the input format for date values, NULL is returned.
- If the timestamp value is NULL, NULL is returned.
- If the timezone value is NULL, NULL is returned.
Example Code
Returns 1692028800000.
select to_utc_timestamp('2023-08-14 17:00:00','PST'); Returns NULL.
select to_utc_timestamp(null, 'PST');
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot