Job Runner

Format Dates and Times

Overview

This Do converts dates and times to a specified format.

Usage

The converted string is set as the result of the Action.

To access the conversion result, create a new Action and write a formula that references the result of this Action.

For example, if you execute “Format Dates and Times” with Action Number 1, you can then add a new Action with the Do “Set Field Value” and enter the following formula in the “Value” parameter:

=$1

This formula will return the result of Action Number 1.

Parameters

Set Date/Time, Date Format, and Time Format.

Date/Time

Enter a date or time value.

If you want to access the value of a Date field or a Date and time field, input the field code as shown in the example below:

=Date_2

Remember to use an equals sign (=) before the field code to access the value of that field.

Use the syntax below to use the current date/time.

=now()

This will set the current date/time as the value of this parameter.

Values that cannot be interpreted as empty values or dates cause an error at runtime.

Date Format

You can choose between multiple options.

If the source data has no date and only has a time, select “No date.”

You can still select “No date” even when the source data includes the date, such as a date and time.

Time Format

You can choose between a 12-hour clock or a 24-hour clock.

If the source data has no time and only has a date, select “No time.”

You can still select “No time” even when the source data includes the time, such as a date and time.

Alternative Solutions

Another way to format a date is to write a formula with a function.

For example, you can write a formula in the Value parameter of the Do ”Set Field Value” like this:

=format(Date_2, "YYYY/MM/DD")

This formula uses the format function to convert the date value.

While this solution eliminates the need for a new Action just to format the value, it requires a good understanding of formatting rules (e.g. “YYYY/MM/DD”) and should, therefore, only be utilized by experienced users.