TO_UTC_TIMESTAMP
Description
The TO_UTC_TIMESTAMP function is used to convert a time in a specified time zone to UTC time. This function accepts two parameters: a timestamp expression (expr) and a time zone string (tz). The function returns a timestamp representing the converted UTC time.
Parameter Description
- expr: Timestamp type, representing the time to be converted.
- tz: String type, representing the time zone of the input time.
Return Result
- Returns a timestamp representing the converted UTC time.
Usage Example
- Convert Beijing time to UTC time:
- 将纽约时间转换为 UTC 时间:
- Convert Los Angeles time to UTC time:
- Convert London time to UTC time:
Through the above example, it can be seen that the TO_UTC_TIMESTAMP function can conveniently convert local times from different regions to UTC time, making it easier to perform cross-time zone time comparisons and calculations.