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 lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:unixtime(MyDate) |
---|
|
unixtime(MyDate) |
Output: Returns the Unix time values from the MyDate
column.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:unixtime(datetime_col) |
---|
|
unixtime(datetime_col) |
Argument | Required? | Data Type | Description |
---|
datetime_col | Y | datetime | Name of column whose Unix time values are to be computed |
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).
Required? | Data Type | Example Value |
---|
Yes | Datetime | myDate |
Include Page |
---|
| EXAMPLE - Unixtime Functions |
---|
| EXAMPLE - Unixtime Functions |
---|
|