Provide bsl::formatter specialization for bdlt::DateTz.
Outline
Purpose
Provide bsl::formatter specialization for bdlt::DateTz.
Classes
- bdlt::DateTzFormatter: datetz formatter for
bslfmt framework
- bsl::formatter<bdlt::DateTz, t_CHAR>: specialization
- See also
- bdlt_datetz, bdlt_dateformatter, bslfmt_formatter
Description
This component provides bdlt::DateTzFormatter and a specialization of bsl::formatter that allow bsl::format to output values of bdlt::DateTz.
The formatter interprets the following modifiers:
- '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 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) all of the above will yield results for
bdlt::DateTz::localDate().
- Time Zone: 'z' (2 digit hour, 2 digit minute)
- Compound: 'D' (default local date format), 'F' (ISO 8601 local date format) "{}" (default local date format with time zone), 'i' (ISO 8601 local date format with time zone).