date-to-text

Converts a date/time value to text in a specified format

Takes given date (with specified format) and converts it to text. Or converts the current date-time into text.

Arguments

Inputs:

value: The input date/time value.\nIf unspecified, the current date/time will be used.

format: The format of the date, based on Unicode Technical Standard #35. If unspecified, defaults to 'ISO 8601'. https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table

locale: A language locale to be used when formatting the values. See https://github.com/moment/moment/tree/develop/locale. If unspecified, it defaults to 'en-GB'. Essentially, this determines the alphanumeric display beyond the format specified above. If the specified format contains location- or language-dependent variables (e.g. day-names, month-names, week numbers, etc), then the locale will affect how they look (e.g. 'Tuesday' or 'Mardi')

Output:

text: The date as formatted text.

Example

Date-to-text can be used to create a timestamp of when the data-flo was run.

This data-flo uses the Date-to-text adaptor to create a timestamp, then concatenates that timestamp with other text (concatenate-text) to update the name of a Microreact project. The title of the Microreact project thus always reflects when it was updated using Data-flo.

Possible use cases

  • Preparing a date to be used as input to another adaptor's text-data-type argument.

  • Updating a Microreact project name with the latest date-time the data was refreshed. This entails leaving the value argument blank and concatenating the date text output with the rest of the Microreact project name.

Last updated