CONVERT_TZ#

Converts a datetime value datetime from the time zone given by source_timezone to the time zone given by destination_timezone and returns the resulting value.

Syntax#

CONVERT_TZ (datetime, source_timezone, destination_timezone)

Arguments#

datetime

A datetime value. User-defined variables are valid. Function treats the input verbatim and the value as beloging to the source_timezone.

source_timezone

Is an expression that can be resolved to an varchar or nvarchar. User-defined variables are valid. The result has to be one of the time zones listed in sys.time_zone_info.

destination_timezone

Is an expression that can be resolved to an varchar or nvarchar. User-defined variables are valid. The result has to be one of the time zones listed in sys.time_zone_info.

Return types#

The return data type is the data type of the datetime argument, except for string literals. The return data type for a string literal is datetime.

Example#

SELECT CONVERT_TZ(GetDate(), 'E. Europe Standard Time', 'Central Europe Standard Time')

See Also#