Timezone Functions

CURRENT_DATE( <timezone> )

Returns the current date in a given timezone at the start of a query.

> select current_date('UTC-11');
2023-01-24

CURRENT_TIMESTAMP( <timezone> )

Returns the current date & time in a given timezone at the start of a query, in the yyyy-mm-dd hh:mm:ss timestamp format.

> select current_timestamp('America/Anchorage');
2023-01-25 08:08:00

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