Add glibc ext for day of month and week of year (#3976)

This commit is contained in:
ZaheenJ
2024-05-31 03:20:56 +10:00
committed by GitHub
parent cddb41f633
commit ca8eeb09ee
3 changed files with 79 additions and 48 deletions

View File

@@ -267,9 +267,10 @@ as `std::tm` have the following syntax:
<pre>
chrono_format_spec ::= [[<a href="#format-spec">fill</a>]<a href="#format-spec">align</a>][<a href="#format-spec">width</a>]["." <a href="#format-spec">precision</a>][chrono_specs]
chrono_specs ::= [chrono_specs] conversion_spec | chrono_specs literal_char
conversion_spec ::= "%" [modifier] chrono_type
conversion_spec ::= "%" [padding_modifier] [locale_modifier] chrono_type
literal_char ::= &lt;a character other than '{', '}' or '%'>
modifier ::= "E" | "O"
padding_modifier ::= "-" | "_" | "0"
locale_modifier ::= "E" | "O"
chrono_type ::= "a" | "A" | "b" | "B" | "c" | "C" | "d" | "D" | "e" | "F" |
"g" | "G" | "h" | "H" | "I" | "j" | "m" | "M" | "n" | "p" |
"q" | "Q" | "r" | "R" | "S" | "t" | "T" | "u" | "U" | "V" |
@@ -327,6 +328,17 @@ The available presentation types (*chrono_type*) are:
Specifiers that have a calendaric component such as `'d'` (the day of
month) are valid only for `std::tm` and time points but not durations.
The available padding modifiers (*padding_modifier*) are:
| Type | Meaning |
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `'-'` | Pad a numeric result with spaces. |
| `'_'` | Do not pad a numeric result string. |
| `'0'` | Pad a numeric result string with zeros. |
Currently, these modifiers are only supported for the ``'H', 'I', 'M', 'S', 'U', 'V'``
and ``'W'`` presentation types.
## Range Format Specifications
Format specifications for range types have the following syntax: