CLDR a
AM/PM marker.
PM
at the reference instant, Mon, Jan 2 2006, 3:04:05 PM MST
The day period (AM/PM). Case differs by language and locale: strftime %p is uppercase in C locale, Ruby offers %P lowercase, CLDR follows locale data.
| Language | Token | Caveat |
|---|---|---|
| C / POSIX strftime | %p | The locale's equivalent of a.m./p.m. — can be empty in locales without day periods. |
| C# custom format | tt | A single t prints only the first character (P) of the designator. |
| CLDR / ICU pattern | a | Case follows the locale; b adds noon/midnight and B flexible day periods like "at night". |
| Go time layout | PM | Write pm for lowercase output. |
| Java DateTimeFormatter | a | Locale text; B gives day periods like 'in the morning'. |
| Moment.js format | A | Lowercase a gives am/pm. |
| PHP date() | A | Uppercase AM/PM; lowercase a gives am/pm. |
| Python strftime | %p | Locale-dependent; empty in some locales that don't use day periods. |
| Ruby strftime | %p | Uppercase AM/PM; %P gives lowercase am/pm — the case of the letter is inverted from what you might expect. |
| Rust chrono | %p | Uppercase AM/PM; %P gives lowercase am/pm. |
Definition anchored to Unicode UTS #35 — Date Field Symbol Table.