Format Datetime
Transforms a DateTime
into a string with a format.
Description
Converts a DateTime
into a string by applying a format.
The format string follows the Unicode technical standard and is very flexible as it takes a string of tokens and replaces them with their corresponding values.
Examples:
Format | Result |
---|---|
"MM/dd/yyyy" | "02/11/2014" |
"h 'o''clock'" | "3 o'clock" |
See <a href="https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table" target="_blank">Date Field Symbol Table</a> for the full list of tokens.
Inputs
- datetime (DateTime): The date and time to format.
- format (String): The format to apply (see above).
Outputs
- formatted datetime (String): The resulting string.