convertTimetoEpoch (time)
- 05 Dec 2024
-
DarkLight
-
PDF
convertTimetoEpoch (time)
- Updated on 05 Dec 2024
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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.
Input Properties
Incoming | Type | Description | Example |
---|---|---|---|
inputTime |
Object | Required. The date/timestamp to convert. | { "time": "2023-04-28T01:21:14.052000-1100", "formatString": "YYYY-MM-DDTHH:mm:ss.SSSSSSZZ" } |
EpochFormat |
Enum | Required. Represents the Epoch format in which the inputTime is converted. Allowed values are "Seconds" or "Milliseconds". |
Seconds |
Output Properties
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
Was this article helpful?