SwitchTimeZone

Description

Changes a datetime value's time zone from the value's original time zone to the time zone given in tz_string and returns the value.

Syntax

SwitchTimeZone(datetime_expression, tz_value)

Arguments

  datetime_expression - datetime expression in original time zone. 

  tz_value - string representing the target timezone. See http://joda-time.sourceforge.net/timezones.html for available time zone values.

Examples

SwitchTimeZone(ToDate('2014-11-01T23:30:00+02:00'),'America/Chicago') returns 2014-11-01T15:30:00-06:00

Return value datatype

Datetime

Impact of null value

If datetime_value is null, returns null. If tz_value is null or invalid, an exception is raised.

Feedback and Knowledge Base