-3- Each conversion specifier conversion-spec is replaced by appropriate characters as described in Table 101 ([tab:time.format.spec]); the formats specified in ISO 8601:2004 shall be used where so described. Some of the conversion specifiers depend on the formatting locale. If the string literal encoding is a Unicode encoding form and the locale is among an implementation-defined set of locales, each replacement that depends on the locale is performed as if the replacement character sequence is converted to the string literal encoding. If the formatted object type being formatted does not contain the information the conversion specifier refers to, an exception of type format_error
is thrown.
[Example ?: A duration
does not contain enough information to format as a weekday using %w
. A weekday_indexed
does contain enough information to format using %w
and Monday[7]
can be formatted as "1"
even though Monday[7].ok()
is false
. A month_day
does not contain enough information to format as the day of the year using %j
, even when the month()
part is January
. — end example]
However, if a flag refers to a "time of day" (e.g., %H
, %I
, %p
, etc.), then a specialization of duration
is interpreted as the time of day elapsed since midnight.
-4- The result of formatting a std::chrono::duration
instance holding a negative value, or an hh_mm_ss
object h
for which h.is_negative()
is true
, is equivalent to the output of the corresponding positive value, with a STATICALLY-WIDEN<charT>("-")
character sequence placed before the replacement of the initial conversion specifier.
[Example 1:
cout << format("{:%T}", -10'000s); // prints: -02:46:40
cout << format("{:%H:%M:%S}", -10'000s); // prints: -02:46:40
cout << format("minutes {:%M, hours %H, seconds %S}", -10'000s);
// prints: minutes -46, hours 02, seconds 40
— end example]
-5- Unless explicitly requested, the result of formatting a chrono type does not contain time zone abbreviation and time zone offset information. If the information is available, the conversion specifiers %Z
and %z
will format this information (respectively).
[Note 1: If the information is not available and a %Z
or %z
conversion specifier appears in the chrono-format-spec, an exception of type format_error
is thrown, as described above. — end note]
-6- If the type being formatted does not contain the information that the format flag needs, an exception of type format_error
is thrown, as described above.
[Example 2: A duration
does not contain enough information to format as a weekday
. — end example]
However, if a flag refers to a "time of day" (e.g., %H
, %I
, %p
, etc.), then a specialization of duration
is interpreted as the time of day elapsed since midnight.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4