Provide bsl::formatter specialization for bdlt::DatetimeTz.
Outline
Purpose
Provide bsl::formatter specialization for bdlt::DatetimeTz.
Classes
- See also
- bdlt_datetimetz, bdlt_dateformatter, bdlt_timeformatter, bslfmt_formatter
Description
This component provides bdlt::DatetimeTzFormatter and a specialization of bsl::formatter that allow bsl::format to output values of bdlt::DatetimeTz.
The formatter interprets the following modifiers:
- ',' (comma) - the decimal point when displaying seconds is shown as a comma rather than a period.
- 'Z' - if the offset is zero, output the time zone as 'Z', otherwise output it normally.
- ':' (colon) - always print a colon between hours and minutes
- '_' (underscore) - never print a colon between hours and minutes Note that it is an error for both ':' and '_' to be specified at the same time.
The formatter supports various date and format specifiers including:
- Year: 'Y' (4-digit), 'y' (2-digit), 'C' (century)
- Month: 'm' (numeric), 'b'/'h' (abbreviated name)
- Day: 'd' (zero-padded), 'e' (space-padded)
- Day of week: 'a' (abbreviated name), 'u'/'w' (numeric)
- Day of year: 'j' (numeric)
- Hour: 'H' (2 digit) "00" - "24"
- Hour: 'I' (2 digit) "01" - "12"
- AM/PM: 'p' - "AM" or "PM"
- Minute: 'M' (2 digits) "00" - "59"
- Second: 'S' (2 digits) "00" - "59"
- Composite: 'T' (time in default format), 'D' (date in default format), 'F' (date in ISO 8601 format)
- Time Zone Offset: 'z' (2 digit hour, 2 digit minute)
- Composite: "{}" (
localDatetime() in default format with time zone) or 'i' (localDatetime() in ISO 8601 format with time zone)