Task References

On this page:

convertTimezone (time)

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

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.

Examples

Example 1

In this IAP example:

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

  • The NewTimezone property is set to +01:00, which represents a one hour increment.

  • With this example, if the inputTime was 03:00, then the value of the new time zone in convertedTime would be 04:00.

    convertTimezone01

Example 2

In this IAP example:

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

  • The NewTimezone property is set to -02:00, which represents a two hour time difference.

  • With this example, if the inputTime was 03:00, then the value of the new time zone in convertedTime would be 01:00. Essentially, the value of the inputTime minus two hours.

    convertTimezone02

Example 3

In this IAP example:

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

  • The NewTimezone property is set to +00:00, which represents no offset.

  • With this example, if the inputTime was 03:00, then the value of the new time zone in convertedTime would still be 03:00. Essentially, the value of the inputTime plus zero hours.

    convertTimezone03