convertunix#
Convert a UNIX timestamp into an easy-to-read datetime format.
Note
This guide explains how to configure the convertunix instruction. To learn about another instruction, go back to the Custom scripts available in Adverity overview.
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 Instructions 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#
Campaign |
Campaign Start Date |
---|---|
Brand |
1546344000 |
Outreach |
1547569800 |
Organic Growth |
1549022400 |
Data table after transformation#
Campaign |
Campaign Start Date |
---|---|
Brand |
Jan. 1, 2019, noon |
Outreach |
Jan. 15, 2019, 4:30 p.m. |
Organic Growth |
Feb. 1, 2019, noon |