This activity is used to convert date and time into a specific format. This can either be used with the date returned by other activities or with a manually set date and time.
When this activity is added to the workflow, an 'Assign value to variable' activity block connected to it is automatically added. It stores the output result. It makes it convenient to use the output in other activities by choosing the Save the previous step result option.
It is important that the output of this activity is String, not Date.
'Export to format' is suitable in some business scenarios when users need to fill reports (for example) or do some other tasks where they have to present the date in a specific form. This is the purpose of this activity. You can just pick up the output and input it to a certain form, field, text file or whatever.
It also simplifies interaction with dates because it does not require to write any additional code using the Date object which is possible but not everyone can do it.
The first parameter here is Date. It is required. There are a few ways to set it.
Set a value option either lets you input the date and time manually or use the calendar to choose the date and time. It opens upon clicking the input field.
A convenient way to set the date and time
Note that when using the "Save the previous step result" and "Calculate a value" options, you must enter the date according to RFC 2822 and ISO 8601 standards. According to RFC 2822, there are many date entry options, such as
10 Jun 2021. ISO 8601 also supports multiple date formats, such as YYYY-MM-DD that is
2021-06-10, which also stands for June 10, 2021.
The next parameter is Include Timezone. When it is turned on, you will see the dropdown list containing the UTC timezones. It will be added to the output.
Include Timezone parameter
And the last parameter is Transform to. This is a required one. It defines the format of the output date and time. There are a lot of different formats in this dropdown list.
Transform to parameter and the available options
Now let us take a look at how the output could look like. In this example we chose the YYYY-MM-DD HH:mm:ss format, checked the Include Timezone option and displayed the result using 'User notification' activity.
A complete workflow example. Here we got the current date, saved it, exported it, saved the result and displayed it
The result in an easy to perceive form