HOW TO: Convert the timezone in a Taskflow Notification Task step by using a formula

Version 4

    You can configure the Notification Task step in a taskflow to send an email notification to specified recipients. For example, you can send an email notification to inform recipients about the taskflow status including the start time and end time.

     

    Consider you have a taskflow that contains a Data Task step and a Notification Task step. You want to pass the default output parameters from the data task such as Start time and End time to the email notification.

     

    By default, the Start Time and End Time parameters of a data task in a taskflow display the time in the UTC or GMT format. However, you can use XQuery to convert the timezone based on your requirements.

     

    Before sending an email notification, you can convert the timezone based on the recipient location.

     

    To convert the timezone, perform the following steps:

    1. In Data Integration, select Explore.
    2. Navigate to the taskflow and select the Notification Task step in which you want to convert the timezone.
    3. Click the Details tab.

        4. In the Email Content Type field, select HTML.

        5. In the Email Subject or Email Body field, select the type as Formula and click the f(x) icon to open the Expression Editor.

        6. From the Fields section, expand the Output Parameters list. Then, select the Start Time or End Time parameter for the data task and click Add.

    To convert the start time and end time from the UTC to EST timezone, use the following expression:

    {infa:format($temp.<DataTask1>[1]/output[1]/End_Time,"yyyy-mm-dd hh:mm:ss a z", "America/New_York", 'US')}

    For example:

    infa:format($dt,"yyyy-mm-dd'T'HH:mm:ss", "America/New_York", 'US')

    Here, $dt is the Start_Time/End_Time.

    The following image shows the expression to convert the end time from the UTC to EST timezone.

        7. Click OK.