Working with Date and Time in Flow

This doc may or may not have been written in the presence of tachyon particles. ­čÖé

Physics asides apart, when you are building apps with Flow, you may often need to use a date/time content format. Let’s take a quick look at how time, well, Date/Time to be precise, works in Flow.

Date/Time values in Flow are stored in ISO 8601 notation. The format we use is ISO 8601 format + timezone. For example, 2018-09-04T10:52:25+00:00. The data is sent to services in this format as well.

Flow supports standard format strings. We also support custom format strings. If you like, you can also format the Date/Time value differently, based on your choice. Date/Time values can be formatted by setting the contentFormat of the value, or the DateTime property on a type.

When a Date/Time value is referenced in a step or a presentation component in the page layout, the Date/Time value will be always formatted server-side before reaching the browser. Date/Time values displayed in other component types, say table columns, will also be formatted server side by default. If you like, you can disable this behavior by changing the formatValue tenant setting to false via the API.

Date/Time values can be formatted client-side by enabling the formatting setting in a custom player.

The i18n settings can change how the Date/Time value is displayed.

When it comes to inputs, the format of Date/Time as input values are governed by two attributes: dateTimeFormat and dateTimeLocale.