Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3fvyFpxThdRxcozLx
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
== the same pattern in four locales ==
|
|
en_US Tuesday, 1 September 2026
|
|
en_IN Tuesday, 1 September 2026
|
|
hi_IN मंगलवार, 1 सितंबर 2026
|
|
mr_IN मंगळवार, 1 सप्टेंबर 2026
|
|
|
|
== abbreviated month: not what every Indian or British reader expects ==
|
|
en_US 1 Sep 2026
|
|
en_GB 1 Sept 2026
|
|
en_IN 1 Sept 2026
|
|
|
|
== localized styles for en_IN (the pattern is chosen by the locale, not by you) ==
|
|
MEDIUM 1 Sept 2026
|
|
SHORT 01/09/26
|
|
FULL Tuesday, 1 September 2026
|
|
|
|
== AM/PM text per locale, with the hex of every character ==
|
|
en_US [03:30 PM] 30 33 3A 33 30 20 50 4D
|
|
en_IN [03:30 pm] 30 33 3A 33 30 20 70 6D
|
|
|
|
== ofLocalizedTime(SHORT): the space before PM is not a space ==
|
|
en_US 33 3A 33 30 202F 50 4D
|
|
en_IN 33 3A 33 30 202F 70 6D
|
|
|
|
== parsing it back with a plain space ==
|
|
DateTimeParseException: Text '3:30 PM' could not be parsed at index 4
|
|
15:30
|
|
|
|
== the other direction: text that CONTAINS U+202F, read by a pattern with a plain space ==
|
|
DateTimeParseException: Text '3:30_PM' could not be parsed at index 4
|
|
|
|
== parseLenient() accepts either kind of space, in both directions ==
|
|
localized SHORT, input with plain space : 15:30
|
|
pattern h:mm a, input with U+202F : 15:30
|