Timezone Functions

DATETIME( <expr> [, <timezone>] )

Returns the timestamp expression formatted to the given timezone. The default timezone is UTC.

> select datetime(datetime(current_timestamp, 'UTC'), 'Pacific/Samoa')
2023-01-05 22:27:20

CONVERT_TIMEZONE( <source_timezone>, <target_timezone>, <source_timestamp> )

Returns the timestamp expression formatted to the given timezone. The default timezone is UTC.

> select convert_timezone('America/Los_Angeles','Africa/Cairo','2022-05-01 07:10:12');
2022-05-01 16:10:12
> select convert_timezone('America/Los_Angeles','2016-10-05 00:00:00');
2016-10-04 17:00:00

Last updated