Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r097

D toc

Excerpt

Converts Datetime value in specified time zone to corresponding value in UTC time zone. Input can be a column of Datetime values, a literal Datetime value, or a function returning Datetime values.

  • Inputs with time zone offsets are invalid.
  • Specified time zone must be a string literal of one of the supported time zone values.

D s lang vs sql

D s
snippetBasic

Column reference values:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:converttoutc(myTimestamp,'US/Mountain')

converttoutc(myTimestamp,'US/Mountain')

Output: Returns the UTC values of the myTimestamp converted from US Mountain time zone.

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:dateformat(time(hour_integer_col,minute_integer_col,second_integer_col ),'time_format_string')

converttoutc(date, 'enum-timezone')


ArgumentRequired?Data TypeDescription
dateYdatetimeName of Datetime column, Datetime literal, or function returning a Datetime value.
enum-timezone-stringYstringCase-sensitive string literal value corresponding to the source time zone.

D s lang notes

date

Name of a column containing Datetime values, a literal Datetime value, or a function returning Datetime values to convert.

Tip

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. 

  • Column references with time zone offsets are invalid.
  • Missing values for this function in the source data result in missing values in the output.
  • Multiple columns and wildcards are not supported.

D s
snippetusage

Required?Data TypeExample Value
YesDatetime (column reference, function, or literal)sourceTime

enum-timezone-string

String literal value for the time zone from which to convert.

Info

NOTE: These values are case-sensitive.

Example values:

Code Block
'America/Puerto_Rico'
'US/Eastern'
'US/Central'
'US/Mountain'
'US/Pacific'
'US/Alaska'
'US/Hawaii'

D s
snippetExamples

Example - Time zone conversion

Include Page
EXAMPLE - Time Zone Conversion Functions
EXAMPLE - Time Zone Conversion Functions

D s also
labeldate