When working with date and time values (ie. DateTime values) in flow, they may look like:
You may format these values to look like:
- 6/15/2009 1:45 PM
- Monday, June 15, 2009
This is done through the use of Date and Time Format Strings passed to the
A standard format string is a single character (ex. 'd', 'g', 'G', this is case-sensitive) that corresponds to a specific pattern.
For example the format string 'g' corresponds to the General date/time pattern (short time):
formatDateTime('2009-06-15T13:45:30', 'g') -> 6/15/2009 1:45 PM
A custom format string is any string with more than one character (ex. 'M/dd/yyyy h:mm tt') that can control the visibility, positioning, precision of the month, day, hour, second etc. of the DateTime value.
For example the format string 'M/dd/yyyy h:mm tt' represents the same pattern as the standard format string 'g' as described above:
formatDateTime('2009-06-15T13:45:30', 'M/dd/yyyy h:mm tt') -> 6/15/2009 1:45 PM
See below for more information about available standard format patterns and how to construct a custom format string.
- Select the input field where you want the formatted DateTime value
- Go to the expression editor ('Add dynamic content' -> click on 'Expression' tab)
formatDateTime()(or look under 'Date and time' functions)
- Provide the value (can be dynamic content) to be formatted (surrounded by single quotes)
- Provide the format string (surrounded by single quotes)
- The full expression should look like:
formatDateTime('<your-value>', 'dd/MM/yyyy hh:mm tt')
- Click 'Ok'