convertTimezone (time)
  • 23 May 2023
  • Dark
    Light
  • PDF

convertTimezone (time)

  • Dark
    Light
  • PDF

Article summary

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 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.

    convertTimezone-ex01

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.

    convertTimezone-ex02

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.

    convertTimezone-ex03


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?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.