Converts Datetime value in specified time zone to corresponding value second specified time zone. Input can be a column of Datetime values, a literal Datetime value, or a function returning Datetime values. |
Column reference values:
converttimezone(myTimestamp,'US/Mountain','US/Pacific') |
Output: Returns the UTC values of the myTimestamp
converted from US Mountain time zone to US Pacific time zone.
converttimezone(date, 'enum-timezone1','enum-timezone2') |
Argument | Required? | Data Type | Description |
---|---|---|---|
date | Y | datetime | Name of Datetime column, Datetime literal, or function returning a Datetime value. |
enum-timezone-string1, enum-timezone-string2 | Y | string | Case-sensitive string literal value corresponding to the source or target time zone. |
Name of a column containing Datetime values, a literal Datetime value, or a function returning Datetime values to convert.
Tip: Use the DATEFORMAT function to wrap values into acceptable formats. See DATEFORMAT Function. |
If an input value is invalid for Datetime data type, a null value is returned.
Required? | Data Type | Example Value |
---|---|---|
Yes | Datetime (column reference, function, or literal) | sourceTime |
String literal value for the time zone 1) to convert from and 2) to convert to.
NOTE: These values are case-sensitive. |
Example values:
'America/Puerto_Rico' 'US/Eastern' 'US/Central' 'US/Mountain' 'US/Pacific' 'US/Alaska' 'US/Hawaii' |
For more information on supported time formatting strings, see Supported Data Types.