- 23 May 2023
-
DarkLight
-
PDF
convertTimezone (time)
- Updated on 23 May 2023
-
DarkLight
-
PDF
convertTimezone Task Purpose
The convertTimezone task converts a timestamp by offsetting the input value in whole hour increments. Since this task does not take true UTC time into account, the value of the input time is always considered to be the "0:00" marker (i.e., no offset), and the output value is the offset chosen for the input time. The output format will be the same format as specified in the input time.
Potential Use Case
Use this task if your workflow imports a timestamp from a device in a different time zone, and you need to offset the imported timestamp to chronologically blend log file history with other devices located in your time zone.
Properties
Input and output properties are shown below.
Incoming | Type | Description |
---|---|---|
inputTime |
Object | Required. The date/timestamp to convert. |
NewTimezone |
Enum | Required. A list of hour offsets applied to the inputTime value to get the new time zone. |
Outgoing | Type | Description |
---|---|---|
convertedTime |
Object | The inputTime converted to the NewTimezone value. |
Example 1
In this IAP example:
-
The
inputTime
variable is provided by thegetTime
reference task, which is located elsewhere in the workflow. The reference variable provided by thegetTime
task istime
. -
The
NewTimezone
property is set to+01:00
, which represents a one hour increment. -
With this example, if the
inputTime
was03:00
, then the value of the new time zone inconvertedTime
would be04:00
.
Example 2
In this IAP example:
-
The
inputTime
variable is provided by thegetTime
reference task, which is located elsewhere in the workflow. The reference variable provided by thegetTime
task istime
. -
The
NewTimezone
property is set to-02:00
, which represents a two hour time difference. -
With this example, if the
inputTime
was03:00
, then the value of the new time zone inconvertedTime
would be01:00
. Essentially, the value of theinputTime
minus two hours.
Example 3
In this IAP example:
-
The
inputTime
variable is provided by thegetTime
reference task, which is located elsewhere in the workflow. The reference variable provided by thegetTime
task istime
. -
The
NewTimezone
property is set to+00:00
, which represents no offset. -
With this example, if the
inputTime
was03:00
, then the value of the new time zone inconvertedTime
would still be03:00
. Essentially, the value of theinputTime
plus zero hours.
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