From Unix Timestamp

Description

This operation converts Unix timestamps into human-readable date and time formats. Unix timestamps represent the number of seconds (or milliseconds) that have elapsed since the Unix epoch, which began at 00:00:00 UTC on January 1, 1970.


Data types

These are the input/output expected data types for this operation:

Input data

- Integer values representing the Unix timestamps to be converted.

Output data

- A string representing the formatted time.


Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a *):

Time Unit*

Specify the unit of time represented by the input timestamp. Choose one of the following:

  • Seconds

  • Milliseconds

  • Microseconds

  • Nanoseconds

Timezone Output

Specify the timezone of the input date strings. Enter one of the following:

  • UTC

  • GMT

  • PST

  • PDT

  • CET

  • CEST

  • Any IANA time zone

If not provided, the default value is UTC.

Format Output

Specify the desired format of your output date strings. If not provided, the default format is ddd d mmm yyyy hh:mm:ss timezone (for example, Mon 2 Jan 2006 15:04:05 MST)

Note that you must use the following date to represent your required output format:

  • Date - January 02, 2006

  • Time - 15:04:05

For example, imagine you have this input timestamp 978346800 and you want to get the corresponding date in this format: ddd dd mmm yyyy hh:mm:ss

You must enter the following in the Format Output parameter, considering the date above:

  • 02 January 2006 15:04:05

You will get this as your output date:

  • 12 January 1970 07:45:46

You can use any date format supported by Go. For a complete list of supported formats, check this article.

These are some of the supported formats:

  • RFC3339 (for example 2006-01-02T15:04:05Z)

  • ANSIC (for example Mon Jan 2 15:04:05 2006)

  • UnixDate (for example Mon Jan 2 15:04:05 PST 2006)

  • Custom format (for example 02-01-2006 15:04:05)


Example

Suppose you want to convert a series of timestamps into human-readable date strings:

  1. In your Pipeline, open the required Action configuration and select the input Field.

  2. In the Operation field, choose From Unix Timestamp.

  3. Set Time Unit to Seconds.

  4. Set Timezone Output to UTC.

  5. Set Format Output to Mon 2 January 2006 15:04:05 UTC

  6. Give your Output field a name and click Save. The values in your input field will be transformed. For example:

978346800 -> Mon 1 January 2001 11:00:00 UTC

You can try out operations with specific values using the Input field above the operation. You can enter the value in the example above and check the result in the Output field.

Last updated

Was this helpful?