<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/74727>74727</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] Should formatting `year{-99}` with `%C` produce `"-1"` or `"-01"`?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
StephanTLavavej
</td>
</tr>
</table>
<pre>
[N4964](https://isocpp.org/files/papers/N4964.pdf) \[tab:time.format.spec\]:
> Specifier | Replacement
> --- | ---
> `%C` | The year divided by 100 using floored division. If the result is a single decimal digit, it is prefixed with `0`.
https://github.com/llvm/llvm-project/blob/f1200ca7ac88c6ff9aa4fe3b560cf326dc3d4e25/libcxx/test/std/time/time.syn/formatter.year.pass.cpp#L271-L272
For `year{-99}` and `year{-9}`, this test expects `%C='-1'`, but MSVC's STL emits `%C='-01'`. This Standardese isn't exactly a paragon of crystal clarity, but I think this might be a bug in libc++. (Otherwise, it's a bug in MSVC's STL that we'll need to fix.)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE1v4zYQ_TXjy0CCNPpgdPBhY9fAAmkL1EHv_BhZ3NKSQFKJ_e8LyvYmQXvZi2m9eRzOPM6jDMGeRuYtNM_Q7DdyicPkt8fI8yDH1xf5Jt_4x0ZN5poof9RdW0OzB3oaYpwDVN-ADkAHGyY9z_nkT0CH3joOQIdZzuzTn3VbPpseqENodtA8R6mg-hbtmfN-8mcZ8zCzXmP7lLXYQ_H4rX7D48za9pY9gtjhXzw7qfnMY_ygZFm2BrMs-wChLYCaHbTFGnsdGK8sPRr7Zg0bVFcsiwKXYMcT9m6aPJs1GOw05vi9xzgweg6Li2gDSkxMx2hY27N0aOzJRqAd2jU-e-7thQ2-2zik0wtoi_xzN191O9k4LCrX0xno4NzbY8lmP_1gHYEOyk0qiVpSUWgppH560m3fd1LWPVeqaQvdV9QaXZmaqUkJrNKXC9AhckgZQjTpw575vuThOqaUq_CRfZ40yWcZQq7nGah6IVFmLyToc-WHyaeOEhfEc9Z1IPZJWDmaL_gNTprEwQZMRSBfZtYx_LyPag8kshJI3Klqifj78e8dkAh4fH1BPtv_8Iv7hhxfU-ZjlKOR3nBgtGEEEukgqaO7osRZenmaRpx61P4aonSonfQ2Xh_nfU8Fjv_cyjzb0xBRMUpUywntiElGoGeg5xyBnv6MA_t3G_h222uhP7lfSo-DjPjOQMI5HJkNxgl7e8mBuo3ZVqarOrnhbSmKsmtJ1O1m2DaqYtH03Ctua-pFK0wjhei7UrdC9WJjt1RQVVIhyoaaus2flG50qYqmNcSKK6gLPkvr8jRAyYobG8LCW1ELEhsnFbuw-pzoozUgSr7323Xq1HIKUBfOhhg-0kQb3fpCfNrW7PE4TIszeJ-iZKD_m46HER42nP1kFs03iNIIUIJvs5WQ4g5Bddgs3m1_2TBr1-nZWRv_NwAA__-T0Hb3">