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

Generates time values from three inputs of Integer type: hour, minute, and second.

  • Source values can be Integer literals or column references to values that can be inferred as Integers.
  • If any of the source values are invalid or out of range, a missing value is returned.
  • This function must be nested within another function that accepts date values as arguments. See the example below.

D s lang vs sql

D s
snippetBasic

Integer literal values:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:dateformat(time(23,58,59),'HH mm ss')

dateformat(time(23,58,59),'HH mm ss')

Output: Returns the following map:

Code Block
23 58 59

Column reference values:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value: dateformat(time(myHour, myMinute, mySecond), 'hh-mm-ss')

dateformat(time(myHour, myMinute, mySecond), 'hh-mm-ss')

Output: Generates a column of values where:

  • hh = values from myHour column
  • mm = values from myMinute column
  • ss = values from mySecond column

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')

dateformat(time(hour_integer_col,minute_integer_col,second_integer_col ),'time_format_string')


ArgumentRequired?Data TypeDescription
hour_integer_colYintegerName of column or Integer literal representing the hour value to apply to the function
minute_integer_colYintegerName of column or Integer literal representing the minute value to apply to the function
second_integer_colYintegerName of column or Integer literal representing the second value to apply to the function
time_format_stringYstringString literal identifying the time format to apply to the value

D s lang notes

hour_integer_col

Integer literal or name of the column containing integer values for the hour. Values must integers between 0 and 23, inclusive.

  • 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
YesInteger (literal or column reference)15

minute_integer_col

Integer literal or name of the column containing integer values for the minutes. Values must integers between 0 and 59, inclusive.

  • 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
YesInteger (literal or column reference)23

second_integer_col

Integer literal or name of the column containing integer values for the second. Values must integers between 0 and 59, inclusive.

  • 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
YesInteger (literal or column reference)45

time_format_string

For more information, see DATEFORMAT Function.

D s
snippetExamples

Example - date and time functions

Include Page
EXAMPLE - DATE and TIME Functions
EXAMPLE - DATE and TIME Functions

D s also
labeldate