|
2717 | 2717 | \effects
|
2718 | 2718 | Equivalent to:
|
2719 | 2719 | \begin{codeblock}
|
2720 |
| -auto const dp = floor<days>(tp); |
2721 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} {}"), |
2722 |
| - year_month_day{dp}, hh_mm_ss{tp-dp}); |
| 2720 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@("{:L%F %T}"), tp); |
2723 | 2721 | \end{codeblock}
|
2724 | 2722 |
|
2725 | 2723 | \pnum
|
|
2915 | 2913 | \effects
|
2916 | 2914 | Equivalent to:
|
2917 | 2915 | \begin{codeblock}
|
2918 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 2916 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
2919 | 2917 | \end{codeblock}
|
2920 | 2918 |
|
2921 | 2919 | \pnum
|
|
3121 | 3119 | \effects
|
3122 | 3120 | Equivalent to:
|
3123 | 3121 | \begin{codeblock}
|
3124 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3122 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3125 | 3123 | \end{codeblock}
|
3126 | 3124 |
|
3127 | 3125 | \pnum
|
|
3284 | 3282 | \effects
|
3285 | 3283 | Equivalent to:
|
3286 | 3284 | \begin{codeblock}
|
3287 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3285 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3288 | 3286 | \end{codeblock}
|
3289 | 3287 |
|
3290 | 3288 | \pnum
|
|
3407 | 3405 | \effects
|
3408 | 3406 | Equivalent to:
|
3409 | 3407 | \begin{codeblock}
|
3410 |
| -return os << format(@\placeholder{STATICALLY-WIDEN}@<charT>("{:%F %T}"), t); |
| 3408 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%F %T}"), t); |
3411 | 3409 | \end{codeblock}
|
3412 | 3410 | \end{itemdescr}
|
3413 | 3411 |
|
|
4483 | 4481 | Equivalent to:
|
4484 | 4482 | \begin{codeblock}
|
4485 | 4483 | return os << (m.ok() ?
|
4486 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%b}"), m) : |
| 4484 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%b}"), m) : |
4487 | 4485 | format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} is not a valid month"),
|
4488 | 4486 | static_cast<unsigned>(m)));
|
4489 | 4487 | \end{codeblock}
|
|
5210 | 5208 | Equivalent to:
|
5211 | 5209 | \begin{codeblock}
|
5212 | 5210 | return os << (wd.ok() ?
|
5213 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%a}"), wd) : |
| 5211 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%a}"), wd) : |
5214 | 5212 | format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{} is not a valid weekday"),
|
5215 | 5213 | static_cast<unsigned>(wd.wd_)));
|
5216 | 5214 | \end{codeblock}
|
|
5364 | 5362 | \begin{codeblock}
|
5365 | 5363 | auto i = wdi.index();
|
5366 | 5364 | return os << (i >= 1 && i <= 5 ?
|
5367 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[{}]"), wdi.weekday(), i) : |
5368 |
| - format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[{} is not a valid index]"), |
| 5365 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[{}]"), wdi.weekday(), i) : |
| 5366 | + format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[{} is not a valid index]"), |
5369 | 5367 | wdi.weekday(), i));
|
5370 | 5368 | \end{codeblock}
|
5371 | 5369 | \end{itemdescr}
|
|
5467 | 5465 | \effects
|
5468 | 5466 | Equivalent to:
|
5469 | 5467 | \begin{codeblock}
|
5470 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}[last]"), wdl.weekday()); |
| 5468 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}[last]"), wdl.weekday()); |
5471 | 5469 | \end{codeblock}
|
5472 | 5470 | \end{itemdescr}
|
5473 | 5471 |
|
|
5594 | 5592 | \effects
|
5595 | 5593 | Equivalent to:
|
5596 | 5594 | \begin{codeblock}
|
5597 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5595 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{}"), |
5598 | 5596 | md.month(), md.day());
|
5599 | 5597 | \end{codeblock}
|
5600 | 5598 | \end{itemdescr}
|
|
5731 | 5729 | \effects
|
5732 | 5730 | Equivalent to:
|
5733 | 5731 | \begin{codeblock}
|
5734 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/last"), mdl.month()); |
| 5732 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/last"), mdl.month()); |
5735 | 5733 | \end{codeblock}
|
5736 | 5734 | \end{itemdescr}
|
5737 | 5735 |
|
|
5844 | 5842 | \effects
|
5845 | 5843 | Equivalent to:
|
5846 | 5844 | \begin{codeblock}
|
5847 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5845 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{:L}"), |
5848 | 5846 | mwd.month(), mwd.weekday_indexed());
|
5849 | 5847 | \end{codeblock}
|
5850 | 5848 | \end{itemdescr}
|
|
5960 | 5958 | \effects
|
5961 | 5959 | Equivalent to:
|
5962 | 5960 | \begin{codeblock}
|
5963 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 5961 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L}/{:L}"), |
5964 | 5962 | mwdl.month(), mwdl.weekday_last());
|
5965 | 5963 | \end{codeblock}
|
5966 | 5964 | \end{itemdescr}
|
|
6274 | 6272 | \effects
|
6275 | 6273 | Equivalent to:
|
6276 | 6274 | \begin{codeblock}
|
6277 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 6275 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}"), |
6278 | 6276 | ym.year(), ym.month());
|
6279 | 6277 | \end{codeblock}
|
6280 | 6278 | \end{itemdescr}
|
|
7133 | 7131 | \effects
|
7134 | 7132 | Equivalent to:
|
7135 | 7133 | \begin{codeblock}
|
7136 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}"), |
| 7134 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}"), |
7137 | 7135 | ymdl.year(), ymdl.month_day_last());
|
7138 | 7136 | \end{codeblock}
|
7139 | 7137 | \end{itemdescr}
|
|
7529 | 7527 | \effects
|
7530 | 7528 | Equivalent to:
|
7531 | 7529 | \begin{codeblock}
|
7532 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}/{}"), |
| 7530 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}/{:L}"), |
7533 | 7531 | ymwd.year(), ymwd.month(), ymwd.weekday_indexed());
|
7534 | 7532 | \end{codeblock}
|
7535 | 7533 | \end{itemdescr}
|
|
7877 | 7875 | \effects
|
7878 | 7876 | Equivalent to:
|
7879 | 7877 | \begin{codeblock}
|
7880 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{}/{}"), |
| 7878 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{}/{:L}/{:L}"), |
7881 | 7879 | ymwdl.year(), ymwdl.month(), ymwdl.weekday_last());
|
7882 | 7880 | \end{codeblock}
|
7883 | 7881 | \end{itemdescr}
|
|
8623 | 8621 | \effects
|
8624 | 8622 | Equivalent to:
|
8625 | 8623 | \begin{codeblock}
|
8626 |
| -return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%T}"), hms); |
| 8624 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:L%T}"), hms); |
8627 | 8625 | \end{codeblock}
|
8628 | 8626 |
|
8629 | 8627 | \pnum
|
@@ -10100,14 +10098,10 @@
|
10100 | 10098 | \begin{itemdescr}
|
10101 | 10099 | \pnum
|
10102 | 10100 | \effects
|
10103 |
| -Streams |
10104 |
| -the value returned from \tcode{t.get_local_time()} |
10105 |
| -to \tcode{os} |
10106 |
| -using the format \tcode{"\%F \%T \%Z"}. |
10107 |
| - |
10108 |
| -\pnum |
10109 |
| -\returns |
10110 |
| -\tcode{os}. |
| 10101 | +Equivalent to: |
| 10102 | +\begin{codeblock} |
| 10103 | +return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@("{:L%F %T %Z}"), t); |
| 10104 | +\end{codeblock} |
10111 | 10105 | \end{itemdescr}
|
10112 | 10106 |
|
10113 | 10107 | \rSec2[time.zone.leap]{Class \tcode{leap_second}}
|
|
10446 | 10440 |
|
10447 | 10441 | \begin{ncbnf}
|
10448 | 10442 | \fmtnontermdef{chrono-format-spec}\br
|
10449 |
| - \opt{fill-and-align} \opt{width} \opt{precision} \opt{chrono-specs} |
| 10443 | + \opt{fill-and-align} \opt{width} \opt{precision} \opt{\terminal{L}} \opt{chrono-specs} |
10450 | 10444 | \end{ncbnf}
|
10451 | 10445 |
|
10452 | 10446 | \begin{ncbnf}
|
@@ -10495,15 +10489,26 @@
|
10495 | 10489 | represented by \fmtgrammarterm{literal-char}
|
10496 | 10490 | are copied unchanged to the output.
|
10497 | 10491 |
|
| 10492 | +\pnum |
| 10493 | +A \defnadj{formatting}{locale} is an instance of \tcode{locale} |
| 10494 | +used by a formatting function, that is determined as follows: |
| 10495 | +\begin{itemize} |
| 10496 | +\item |
| 10497 | +the \tcode{"C"} locale if the \tcode{L} option |
| 10498 | +is not present in \fmtgrammarterm{chrono-format-spec}, otherwise |
| 10499 | +\item |
| 10500 | +the locale passed to the formatting function if any, otherwise |
| 10501 | +\item |
| 10502 | +the global locale. |
| 10503 | +\end{itemize} |
| 10504 | + |
10498 | 10505 | \pnum
|
10499 | 10506 | Each conversion specifier \fmtgrammarterm{conversion-spec}
|
10500 | 10507 | is replaced by appropriate characters
|
10501 | 10508 | as described in \tref{time.format.spec};
|
10502 | 10509 | the formats specified in ISO 8601:2004 shall be used where so described.
|
10503 | 10510 | Some of the conversion specifiers
|
10504 |
| -depend on the locale that is passed to the formatting function |
10505 |
| -if the latter takes one, |
10506 |
| -or the global locale otherwise. |
| 10511 | +depend on the formatting locale. |
10507 | 10512 | If the formatted object does not contain the information
|
10508 | 10513 | the conversion specifier refers to,
|
10509 | 10514 | an exception of type \tcode{format_error} is thrown.
|
|
10778 | 10783 | If the \fmtgrammarterm{chrono-specs} is omitted,
|
10779 | 10784 | the chrono object is formatted
|
10780 | 10785 | as if by streaming it to \tcode{std::ostringstream os}
|
| 10786 | +with the formatting locale imbued |
10781 | 10787 | and copying \tcode{os.str()} through the output iterator of the context
|
10782 | 10788 | with additional padding and adjustments as specified by the format specifiers.
|
10783 | 10789 | \begin{example}
|
|
0 commit comments