convertunix
On this page
Convert a UNIX timestamp into an easy-to-read datetime format.
Introduction
Use the convertunix instruction to convert a UNIX timestamp into an easy-to-read datetime format.
Creating a custom script transformation using the convertunix instruction
To create and configure a custom script using the convertunix instruction, follow these steps:
-
In the Instruction step, select the convertunix instruction.
-
To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).
- Fields
Enter the name of the column containing the UNIX values to convert.
- As Date
Select this option to return the UNIX time as a date value only. Leave unselected to return the UNIX time as date and time.
- Fail on Error
Select this field to stop the transformation instruction if an error occurs.
- Errorvalue
Enter the value with which to populate the field if an error occurs.
Example
Transformation configuration
- Fields
Campaign Start Date- As Date
Leave this field unselected.
Data table before transformation
Scroll horizontally to see the full table.
Campaign | Campaign Start Date |
|---|---|
Brand | 1546344000 |
Outreach | 1547569800 |
Organic Growth | 1549022400 |
Data table after transformation
Scroll horizontally to see the full table.
Campaign | Campaign Start Date |
|---|---|
Brand | Jan. 1, 2019, noon |
Outreach | Jan. 15, 2019, 4:30 p.m. |
Organic Growth | Feb. 1, 2019, noon |