10-03-22 07:01 PM
Answered! Go to Answer.
11-03-22 12:07 AM
Hi Miya,
To achieve your use case I have created the below sample workflow:
Let's understand each component, first I am using an action called as 'Get Time Zones' from 'Utility - Date and Time Manipulation' which will return me a collection of all the available time zones configured on my operating system. As of now, you can see there are a total of 141 such time zones which are available with me from the returned collection:
So, you need to first figure out what is the local time zone that you have which in my case is 'India Standard Time'. Once, you have determined the time zone ID, you can set a data item with the same initial value or pass it from some configuration file or environment variable as suited per your process. So I call this data item, 'Timezone ID' which holds the Time Zone ID value of my locale:
Next I am using a 'Filter Collection' action from 'Utility - Collection Manipulation' VBO which will return me only the row with ID value that I've set in my data item. My input collection will be 'Time Zones' which was returned to me by the prior action and the filter expression is: "ID ='" & [Timezone ID] & "'"
and I am storing the result in a separate collection called as 'Required Timezone' which will have only one row corresponding to the Time zone ID that we passed in the filter criteria:
NOTE: This step you and previous step if you want you can discard as well if you want now. Since these steps we are using just to check the time zone ID which I can even directly pass going ahead. However if you discard it then just pass the data item: 'Timezone ID' directly in the UTC To Local action as shown ahead.
Once you have obtained the Time Zone ID, now use a Loop stage to iterate through the collection where my date column in UTC format is available. In my case I have take two default columns called ID and Date out of which I will be converting the Date column from UTC to my local time zone value. This collection is called 'Inputs'
Now inside the loop stage, I have used 'UTC To Local' action from 'Utility - Date and Time Manipulation' which will covert any given datetime value into a local date time format based on the time zone ID provided. Here, I am passing the Date column value of my current row of the 'Inputs' collection and I will be passing the ID column value of my 'Required Timezone' collection which I got after filtering . I will store the output to data item of type 'DateTime' called 'Local Date Time':
After this I will use a calculation stage to set the value of 'Local Date Time' data item to the date column of my Inputs Collection:
Before running the workflow, the values I had were like below:
After running the workflow, the values are as follows:
11-03-22 12:07 AM
Hi Miya,
To achieve your use case I have created the below sample workflow:
Let's understand each component, first I am using an action called as 'Get Time Zones' from 'Utility - Date and Time Manipulation' which will return me a collection of all the available time zones configured on my operating system. As of now, you can see there are a total of 141 such time zones which are available with me from the returned collection:
So, you need to first figure out what is the local time zone that you have which in my case is 'India Standard Time'. Once, you have determined the time zone ID, you can set a data item with the same initial value or pass it from some configuration file or environment variable as suited per your process. So I call this data item, 'Timezone ID' which holds the Time Zone ID value of my locale:
Next I am using a 'Filter Collection' action from 'Utility - Collection Manipulation' VBO which will return me only the row with ID value that I've set in my data item. My input collection will be 'Time Zones' which was returned to me by the prior action and the filter expression is: "ID ='" & [Timezone ID] & "'"
and I am storing the result in a separate collection called as 'Required Timezone' which will have only one row corresponding to the Time zone ID that we passed in the filter criteria:
NOTE: This step you and previous step if you want you can discard as well if you want now. Since these steps we are using just to check the time zone ID which I can even directly pass going ahead. However if you discard it then just pass the data item: 'Timezone ID' directly in the UTC To Local action as shown ahead.
Once you have obtained the Time Zone ID, now use a Loop stage to iterate through the collection where my date column in UTC format is available. In my case I have take two default columns called ID and Date out of which I will be converting the Date column from UTC to my local time zone value. This collection is called 'Inputs'
Now inside the loop stage, I have used 'UTC To Local' action from 'Utility - Date and Time Manipulation' which will covert any given datetime value into a local date time format based on the time zone ID provided. Here, I am passing the Date column value of my current row of the 'Inputs' collection and I will be passing the ID column value of my 'Required Timezone' collection which I got after filtering . I will store the output to data item of type 'DateTime' called 'Local Date Time':
After this I will use a calculation stage to set the value of 'Local Date Time' data item to the date column of my Inputs Collection:
Before running the workflow, the values I had were like below:
After running the workflow, the values are as follows:
11-03-22 09:28 PM