Task References

On this page:

convertTimeToEpoch (time)

Purpose

The convertTimeToEpoch task converts a date/timestamp to Epoch Time, which is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT).

Potential Use Case

Use this task reference if a workflow is designed to provide an input timestamp to a downstream interface or system that requires the Epoch Time format.

Properties

Incoming Type Description
inputTime Object Required. The date/timestamp to convert.
EpochFormat Enum Required. Represents the Epoch format in which the inputTime is converted. Allowed values are "Seconds" or "Milliseconds".


Outgoing Type Description
epochTime Number The converted date/timestamp value since January 1, 1970 (midnight UTC/GMT). Reformatted into "Seconds" or "Milliseconds" (as designated by the EpochFormat property).

Examples

Example 1

In this IAP example:

  • The inputTime variable is provided by the output of getTime, a reference task located elsewhere in the workflow. The reference variable provided by the getTime task is time.

  • The EpochFormat property variable is set to Seconds.

  • For this example, the epochTime value produced upon output will be the value of the inputTime in the format of seconds since January 1, 1970.

    convertTimeToEpoch01

Example 2

In this IAP example:

  • The inputTime variable is provided by the output of getTime, a reference task located elsewhere in the workflow. The reference variable provided by the getTime task is time.

  • The EpochFormat property variable is set to Milliseconds.

  • For this example, the epochTime value produced upon output will be the value of the inputTime in the format of milliseconds since January 1, 1970.

    convertTimeToEpoch02