Skip to content

Commit 1119ab4

Browse files
committed
[time.format] Fix description of - insertion and examples.
* Place :% in correct order in example. * Ensure that format specifier is at start of format-specs as required by the grammar. * Clarify that 'leftmost' means 'initial', and doesn't mean the final format specifier in an RTL locale. Fixes #3810.
1 parent 02fe22b commit 1119ab4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/time.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10496,12 +10496,12 @@
1049610496
an \tcode{hh_mm_ss} object \tcode{h} for which \tcode{h.is_negative()} is \tcode{true},
1049710497
is equivalent to the output of the corresponding positive value,
1049810498
with a \tcode{\exposid{STATICALLY-WIDEN}<charT>("-")} character sequence
10499-
placed before the replacement of the leftmost conversion specifier.
10499+
placed before the replacement of the initial conversion specifier.
1050010500
\begin{example}
1050110501
\begin{codeblockdigitsep}
10502-
cout << format("{%:T}", -10'000s); // prints: \tcode{-02:46:40}
10502+
cout << format("{:%T}", -10'000s); // prints: \tcode{-02:46:40}
1050310503
cout << format("{:%H:%M:%S}", -10'000s); // prints: \tcode{-02:46:40}
10504-
cout << format("{:minutes %M, hours %H, seconds %S}", -10'000s);
10504+
cout << format("minutes {:%M, hours %H, seconds %S}", -10'000s);
1050510505
// prints: \tcode{minutes -46, hours 02, seconds 40}
1050610506
\end{codeblockdigitsep}
1050710507
\end{example}

0 commit comments

Comments
 (0)