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 r0810

D toc

Excerpt

Derives the Unixtime (or epoch time) value from a Datetime value. Source value can be a reference to a column containing Datetime values.

Unix time is a date-time format used to express the number of milliseconds that have elapsed since January 1, 1970 00:00:00 (UTC).

  • Unix time does not handle the extra seconds that occur on the extra day of leap years. 

This function factors any timezone values in the inputs.

  •  If you have a column with multiple time zones, you can convert the column to Unixtime so you can perform Date/Time operations with a standardized time zone. 
  • If you want to work with local times, you can truncate the time zone or use other Date functions.
  • If the source Datetime value does not include a valid input for this function, a missing value is returned.

D s lang vs sql

D s
snippetBasic

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:unixtime(MyDate)

unixtime(MyDate)

Output: Returns the Unix time values from the MyDate column.

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:unixtime(datetime_col)

unixtime(datetime_col)


ArgumentRequired?Data TypeDescription
datetime_colYdatetimeName of column whose Unix time values are to be computed

D s lang notes

datetime_col

Name of the column whose Unix time value is to be computed.

  • Missing values for this function in the source data result in missing values in the output.
  • Invalid or out-of-range source values generate missing values in the output.
  • Multiple columns and wildcards are not supported.
  • Includes time zone offset when it converts Date/Time values to unixtime.
  • If the date value does not include a time zone, unixtime uses UTC (0:00).

D s
snippetusage

Required?Data TypeExample Value
YesDatetimemyDate

D s
snippetExamples

Example - Unix time generation and formatting

Include Page
EXAMPLE - Unixtime Functions
EXAMPLE - Unixtime Functions

D s also
labeldate