convertunix

Convert a UNIX timestamp into an easy-to-read datetime format.

This guide explains how to configure the convertunix instruction. To learn about another instruction, go back to the Available custom script instructions overview.

Introduction

Use the convertunix instruction to convert a UNIX timestamp into an easy-to-read datetime format.

Creating a custom script enrichment using the convertunix instruction

To create and configure a custom script using the convertunix instruction, follow these steps:

  1. Create a custom script enrichment.

  2. In the Instructions step, select the convertunix instruction.

  3. 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 enrichment instruction if an error occurs.

Errorvalue

Enter the value with which to populate the field if an error occurs.

Example

Enrichment configuration

Fields

Campaign Start Date

As Date

Leave this field unselected.

Data table before enrichment

Campaign

Campaign Start Date

Brand

1546344000

Outreach

1547569800

Organic Growth

1549022400

Data table after enrichment

Campaign

Campaign Start Date

Brand

Jan. 1, 2019, noon

Outreach

Jan. 15, 2019, 4:30 p.m.

Organic Growth

Feb. 1, 2019, noon