Page tree

 

Support | BlogContact Us | 844.332.2821

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc

Excerpt

Derives the Unixtime 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
snippetBasic

D code

derive value:UNIXTIME(MyDate)

Output: Generates a column of values that computes the Unix time values from the MyDate column.

D s
snippetSyntax

D code

derive value: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