|
2703 | 2703 | \effects
|
2704 | 2704 | Equivalent to:
|
2705 | 2705 | \begin{codeblock}
|
2706 |
| -auto const dp = floor<days>(tp); |
2707 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} {}"), |
2708 |
| - year_month_day{dp}, hh_mm_ss{tp-dp}); |
| 2706 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@("{:L%F %T}"), tp); |
2709 | 2707 | \end{codeblock}
|
2710 | 2708 |
|
2711 | 2709 | \pnum
|
|
2901 | 2899 | \effects
|
2902 | 2900 | Equivalent to:
|
2903 | 2901 | \begin{codeblock}
|
2904 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 2902 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
2905 | 2903 | \end{codeblock}
|
2906 | 2904 |
|
2907 | 2905 | \pnum
|
|
3107 | 3105 | \effects
|
3108 | 3106 | Equivalent to:
|
3109 | 3107 | \begin{codeblock}
|
3110 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3108 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3111 | 3109 | \end{codeblock}
|
3112 | 3110 |
|
3113 | 3111 | \pnum
|
|
3270 | 3268 | \effects
|
3271 | 3269 | Equivalent to:
|
3272 | 3270 | \begin{codeblock}
|
3273 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3271 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3274 | 3272 | \end{codeblock}
|
3275 | 3273 |
|
3276 | 3274 | \pnum
|
|
3393 | 3391 | \effects
|
3394 | 3392 | Equivalent to:
|
3395 | 3393 | \begin{codeblock}
|
3396 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3394 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3397 | 3395 | \end{codeblock}
|
3398 | 3396 | \end{itemdescr}
|
3399 | 3397 |
|
|
4469 | 4467 | Equivalent to:
|
4470 | 4468 | \begin{codeblock}
|
4471 | 4469 | return os << (m.ok() ?
|
4472 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%b}"), m) : |
| 4470 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%b}"), m) : |
4473 | 4471 | format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} is not a valid month"),
|
4474 | 4472 | static_cast<unsigned>(m)));
|
4475 | 4473 | \end{codeblock}
|
|
5196 | 5194 | Equivalent to:
|
5197 | 5195 | \begin{codeblock}
|
5198 | 5196 | return os << (wd.ok() ?
|
5199 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%a}"), wd) : |
| 5197 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%a}"), wd) : |
5200 | 5198 | format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} is not a valid weekday"),
|
5201 | 5199 | static_cast<unsigned>(wd.wd_)));
|
5202 | 5200 | \end{codeblock}
|
|
5350 | 5348 | \begin{codeblock}
|
5351 | 5349 | auto i = wdi.index();
|
5352 | 5350 | return os << (i >= 1 && i <= 5 ?
|
5353 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[{}]"), wdi.weekday(), i) : |
5354 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[{} is not a valid index]"), |
| 5351 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[{}]"), wdi.weekday(), i) : |
| 5352 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[{} is not a valid index]"), |
5355 | 5353 | wdi.weekday(), i));
|
5356 | 5354 | \end{codeblock}
|
5357 | 5355 | \end{itemdescr}
|
|
5453 | 5451 | \effects
|
5454 | 5452 | Equivalent to:
|
5455 | 5453 | \begin{codeblock}
|
5456 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[last]"), wdl.weekday()); |
| 5454 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[last]"), wdl.weekday()); |
5457 | 5455 | \end{codeblock}
|
5458 | 5456 | \end{itemdescr}
|
5459 | 5457 |
|
|
5580 | 5578 | \effects
|
5581 | 5579 | Equivalent to:
|
5582 | 5580 | \begin{codeblock}
|
5583 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5581 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{}"), |
5584 | 5582 | md.month(), md.day());
|
5585 | 5583 | \end{codeblock}
|
5586 | 5584 | \end{itemdescr}
|
|
5717 | 5715 | \effects
|
5718 | 5716 | Equivalent to:
|
5719 | 5717 | \begin{codeblock}
|
5720 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/last"), mdl.month()); |
| 5718 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/last"), mdl.month()); |
5721 | 5719 | \end{codeblock}
|
5722 | 5720 | \end{itemdescr}
|
5723 | 5721 |
|
|
5830 | 5828 | \effects
|
5831 | 5829 | Equivalent to:
|
5832 | 5830 | \begin{codeblock}
|
5833 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5831 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{:L}"), |
5834 | 5832 | mwd.month(), mwd.weekday_indexed());
|
5835 | 5833 | \end{codeblock}
|
5836 | 5834 | \end{itemdescr}
|
|
5946 | 5944 | \effects
|
5947 | 5945 | Equivalent to:
|
5948 | 5946 | \begin{codeblock}
|
5949 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5947 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{:L}"), |
5950 | 5948 | mwdl.month(), mwdl.weekday_last());
|
5951 | 5949 | \end{codeblock}
|
5952 | 5950 | \end{itemdescr}
|
|
6260 | 6258 | \effects
|
6261 | 6259 | Equivalent to:
|
6262 | 6260 | \begin{codeblock}
|
6263 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 6261 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}"), |
6264 | 6262 | ym.year(), ym.month());
|
6265 | 6263 | \end{codeblock}
|
6266 | 6264 | \end{itemdescr}
|
|
7119 | 7117 | \effects
|
7120 | 7118 | Equivalent to:
|
7121 | 7119 | \begin{codeblock}
|
7122 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 7120 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}"), |
7123 | 7121 | ymdl.year(), ymdl.month_day_last());
|
7124 | 7122 | \end{codeblock}
|
7125 | 7123 | \end{itemdescr}
|
|
7515 | 7513 | \effects
|
7516 | 7514 | Equivalent to:
|
7517 | 7515 | \begin{codeblock}
|
7518 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}/{}"), |
| 7516 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}/{:L}"), |
7519 | 7517 | ymwd.year(), ymwd.month(), ymwd.weekday_indexed());
|
7520 | 7518 | \end{codeblock}
|
7521 | 7519 | \end{itemdescr}
|
|
7863 | 7861 | \effects
|
7864 | 7862 | Equivalent to:
|
7865 | 7863 | \begin{codeblock}
|
7866 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}/{}"), |
| 7864 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}/{:L}"), |
7867 | 7865 | ymwdl.year(), ymwdl.month(), ymwdl.weekday_last());
|
7868 | 7866 | \end{codeblock}
|
7869 | 7867 | \end{itemdescr}
|
|
8609 | 8607 | \effects
|
8610 | 8608 | Equivalent to:
|
8611 | 8609 | \begin{codeblock}
|
8612 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%T}"), hms); |
| 8610 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%T}"), hms); |
8613 | 8611 | \end{codeblock}
|
8614 | 8612 |
|
8615 | 8613 | \pnum
|
@@ -10086,14 +10084,10 @@
|
10086 | 10084 | \begin{itemdescr}
|
10087 | 10085 | \pnum
|
10088 | 10086 | \effects
|
10089 |
| -Streams |
10090 |
| -the value returned from \tcode{t.get_local_time()} |
10091 |
| -to \tcode{os} |
10092 |
| -using the format \tcode{"\%F \%T \%Z"}. |
10093 |
| - |
10094 |
| -\pnum |
10095 |
| -\returns |
10096 |
| -\tcode{os}. |
| 10087 | +Equivalent to: |
| 10088 | +\begin{codeblock} |
| 10089 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@("{:L%F %T %Z}"), t); |
| 10090 | +\end{codeblock} |
10097 | 10091 | \end{itemdescr}
|
10098 | 10092 |
|
10099 | 10093 | \rSec2[time.zone.leap]{Class \tcode{leap_second}}
|
|
10432 | 10426 |
|
10433 | 10427 | \begin{ncbnf}
|
10434 | 10428 | \fmtnontermdef{chrono-format-spec}\br
|
10435 |
| - \opt{fill-and-align} \opt{width} \opt{precision} \opt{chrono-specs} |
| 10429 | + \opt{fill-and-align} \opt{width} \opt{precision} \opt{\terminal{L}} \opt{chrono-specs} |
10436 | 10430 | \end{ncbnf}
|
10437 | 10431 |
|
10438 | 10432 | \begin{ncbnf}
|
@@ -10481,15 +10475,26 @@
|
10481 | 10475 | represented by \fmtgrammarterm{literal-char}
|
10482 | 10476 | are copied unchanged to the output.
|
10483 | 10477 |
|
| 10478 | +\pnum |
| 10479 | +A \defnadj{formatting}{locale} is an instance of \tcode{locale} |
| 10480 | +used by a formatting function, that is determined as follows: |
| 10481 | +\begin{itemize} |
| 10482 | +\item |
| 10483 | +the "C" locale if the \tcode{L} option |
| 10484 | +is not present in \fmtgrammarterm{chrono-format-spec}, otherwise |
| 10485 | +\item |
| 10486 | +the locale passed to the formatting function if any, otherwise |
| 10487 | +\item |
| 10488 | +the global locale. |
| 10489 | +\end{itemize} |
| 10490 | + |
10484 | 10491 | \pnum
|
10485 | 10492 | Each conversion specifier \fmtgrammarterm{conversion-spec}
|
10486 | 10493 | is replaced by appropriate characters
|
10487 | 10494 | as described in \tref{time.format.spec};
|
10488 | 10495 | the formats specified in ISO 8601:2004 shall be used where so described.
|
10489 | 10496 | Some of the conversion specifiers
|
10490 |
| -depend on the locale that is passed to the formatting function |
10491 |
| -if the latter takes one, |
10492 |
| -or the global locale otherwise. |
| 10497 | +depend on the formatting locale. |
10493 | 10498 | If the formatted object does not contain the information
|
10494 | 10499 | the conversion specifier refers to,
|
10495 | 10500 | an exception of type \tcode{format_error} is thrown.
|
|
10764 | 10769 | If the \fmtgrammarterm{chrono-specs} is omitted,
|
10765 | 10770 | the chrono object is formatted
|
10766 | 10771 | as if by streaming it to \tcode{std::ostringstream os}
|
| 10772 | +with the formatting locale imbued |
10767 | 10773 | and copying \tcode{os.str()} through the output iterator of the context
|
10768 | 10774 | with additional padding and adjustments as specified by the format specifiers.
|
10769 | 10775 | \begin{example}
|
|
0 commit comments