- 23 May 2023
-
DarkLight
-
PDF
convertTimetoEpoch (time)
- Updated on 23 May 2023
-
DarkLight
-
PDF
convertTimeToEpoch Task 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
Input and output properties are shown below.
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). |
Example 1
In this IAP example:
-
The
inputTime
variable is provided by the output ofgetTime
, a reference task located elsewhere in the workflow. The reference variable provided by thegetTime
task istime
. -
The
EpochFormat
property variable is set toSeconds
. -
For this example, the
epochTime
value produced upon output will be the value of theinputTime
in the format of seconds since January 1, 1970.
Example 2
In this IAP example:
-
The
inputTime
variable is provided by the output ofgetTime
, a reference task located elsewhere in the workflow. The reference variable provided by thegetTime
task istime
. -
The
EpochFormat
property variable is set toMilliseconds
. -
For this example, the
epochTime
value produced upon output will be the value of theinputTime
in the format of milliseconds since January 1, 1970.
Manual Reference Variable Entry (inputTime)
To enter the inputTime
object manually, use the format below for Year-Month-Date-Time ("yyyy-MM-dd 'T' HH:mm:ss.SSSZ").
{"time": "2021-02-26T15:00:00.000Z"}
This format shows as:
2021-02-25 03:00.00