You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(Foundation): %c format specifier emits centiseconds (#3949)
Documentation describes %c as "centisecond" but the implementation was
emitting a single-digit decisecond (millisecond / 100). Bring the code
in line with the documentation: %c now formats and parses a zero-padded
two-digit centisecond value (00 .. 99), i.e. millisecond / 10.
Affects DateTimeFormatter (DateTime and Timespan overloads),
DateTimeParser, and PatternFormatter. The format/parse pair stays
consistent so round-tripping a value via "%H:%M:%S.%c" preserves the
centisecond resolution.
Updated docs in DateTimeFormatter.h and PatternFormatter.h to read
"centisecond (00 .. 99)". Adjusted the existing testCustom assertion
that hard-coded the old single-digit output, and added focused
testFractionalSpecifiers tests in both DateTimeFormatterTest and
DateTimeParserTest covering the boundary values and a format/parse
round trip.
Note: this is a behavioural change for callers that relied on %c
producing a single digit. PatternFormatter timestamps that include %c
(e.g. the format used by the Logger and FastLogger samples,
"%H:%M:%S.%c") will now contain one extra character.
0 commit comments