Provide bsl::formatter specialization for bdlt::TimeTz.
Outline
Purpose
Provide bsl::formatter specialization for bdlt::TimeTz.
Classes
- bdlt::TimeTzFormatter: timetz formatter for
bslfmt framework
- bsl::formatter<bdlt::TimeTz, t_CHAR>: specialization
- See also
- bdlt_timetz, bdlt_timeformatter, bslfmt_formatter
Description
This component provides bdlt::TimeTzFormatter and a specialization of bsl::formatter that allow bsl::format to output values of bdlt::TimeTz.
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 time format specifiers including:
- 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" all the above give figures relative to
bdlt::TimeTz::localTime().
- Offset: 'z' (time zone, 2 digit hour, 2 digit minutes)
- Composite: 'T' (
localTime() in default format), "{}" (time in default format with time zone), 'i' (time in ISO 8601 format with time zone)