## Unicode Technical Standard #35
# Unicode Locale Data Markup Language (LDML)
Part 4: Dates
Version | 40 |
Editors | Peter Edberg and other CLDR committee members |
results for different availableFormats data sets | ||
---|---|---|
requested skeleton | set 1: ...id="H">H</date... ...id="h">h a</date... |
set 2: ...id="H">H</date... ...id="h">h a</date... ...id="Bh">B h</date... |
"h" (or "ah") | "h a" | "h a" |
"bh" | "h b" | "h b" |
"Bh" | "h B" | "B h" |
"H" (or "aH", "bH", "BH") | "H" | "H" |
Type | Examples | Date Pattern | Comments |
---|---|---|---|
weekOfYear | week 15 of 2016 | <dateFormatItem id='yw' count='one'>'week' w 'of' Y<… | The week of construction takes a count attribute, just in case the pattern changes depending on the numeric value. (In the future, we're likely to add an ordinal value, for constructions like “3rd week of March”.) In languages where the month name needs grammatical changes (aside from just the simple addition of a prefix or suffix), localizers will typically use a work-around construction. |
weekOfMonth | week 2 of April 2nd week of April | <dateFormatItem id='MMMMW'' count='one'>'week' W 'of' MMM<… | |
weekOfDate | the week of April 11, 2016 | <field type="week"><relativePeriod>the week of {0}<… | The date pattern that replaces {0} is determined separately and may use the first day or workday of the week, the range of the full week or work week, etc. |
weekOfInterval | the week of April 11–15 |
Element Name | Data Examples | Results/Comment |
---|---|---|
hourFormat | "+HHmm;-HHmm" | "+1200" |
"-1200" | ||
gmtFormat | "GMT{0}" | "GMT-0800" |
"{0}ВпГ" | "-0800ВпГ" | |
gmtZeroFormat | "GMT" | Specifies how GMT/UTC with no explicit offset (implied 0 offset) should be represented. |
regionFormat | "{0} Time" | "Japan Time" |
"Hora de {0}" | "Hora de Japón" | |
regionFormat type="daylight" (or "standard") | "{0} Daylight Time" | "France Daylight Time" |
"horario de verano de {0}" | "horario de verano de Francia" | |
fallbackFormat | "{1} ({0})" | "Pacific Time (Canada)" |
Pattern field length | Typical style, alphanumeric item | Typical style, alpha-only item |
---|---|---|
1 | Numeric, 1-2 digits (e.g. M) | Abbreviated (e.g. E, EE, EEE) |
2 | Numeric, 2 digits (e.g. MM) | |
3 | Abbreviated (e.g. MMM) | |
4 | Wide / Long / Full (e.g. MMMM, EEEE) | |
5 | Narrow (e.g. MMMMM, EEEEE) (The counter-intuitive use of 5 letters for this is forced by backwards compatibility) |
Field Type | Sym. | Field Patterns | Examples | Description | |
---|---|---|---|---|---|
era | G | G..GGG | AD [variant: CE] | Abbreviated | Era name. Era string for the current date. |
GGGG | Anno Domini [variant: Common Era] | Wide | |||
GGGGG | A | Narrow | |||
year | y | y | 2, 20, 201, 2017, 20173 | Calendar year (numeric). In most cases the length of the y field specifies the minimum number of digits to display, zero-padded as necessary; more digits will be displayed if needed to show the full year. However, “yy” requests just the two low-order digits of the year, zero-padded as necessary. For most use cases, “y” or “yy” should be adequate. | |
yy | 02, 20, 01, 17, 73 | ||||
yyy | 002, 020, 201, 2017, 20173 | ||||
yyyy | 0002, 0020, 0201, 2017, 20173 | ||||
yyyyy+ | ... | ||||
Y | Y | 2, 20, 201, 2017, 20173 | Year in “Week of Year” based calendars in which the year transition occurs on a week boundary; may differ from calendar year ‘y’ near a year transition. This numeric year designation is used in conjunction with pattern character ‘w’ in the ISO year-week calendar as defined by ISO 8601, but can be used in non-Gregorian based calendar systems where week date processing is desired. The field length is interpreted in the same was as for ‘y’; that is, “yy” specifies use of the two low-order year digits, while any other field length specifies a minimum number of digits to display. | ||
YY | 02, 20, 01, 17, 73 | ||||
YYY | 002, 020, 201, 2017, 20173 | ||||
YYYY | 0002, 0020, 0201, 2017, 20173 | ||||
YYYYY+ | ... | ||||
u | u+ | 4601 | Extended year (numeric). This is a single number designating the year of this calendar system, encompassing all supra-year fields. For example, for the Julian calendar system, year numbers are positive, with an era of BCE or CE. An extended year value for the Julian calendar system assigns positive values to CE years and negative values to BCE years, with 1 BCE being year 0. For ‘u’, all field lengths specify a minimum number of digits; there is no special interpretation for “uu”. | ||
U | U..UUU | 甲子 | Abbreviated | Cyclic year name. Calendars such as the Chinese lunar calendar (and related calendars) and the Hindu calendars use 60-year cycles of year names.
If the calendar does not provide cyclic year name data, or if the year value to be formatted is out of the range of years for which cyclic name data is provided, then numeric formatting is used (behaves like 'y'). Currently the data only provides abbreviated names, which will be used for all requested name widths. | |
UUUU | 甲子 [for now] | Wide | |||
UUUUU | 甲子 [for now] | Narrow | |||
r | r+ | 2017 | Related Gregorian year (numeric). For non-Gregorian calendars, this corresponds to the extended Gregorian year in which the calendar’s year begins. Related Gregorian years are often displayed, for example, when formatting dates in the Japanese calendar — e.g. “2012(平成24)年1月15日” — or in the Chinese calendar — e.g. “2012壬辰年腊月初四”. The related Gregorian year is usually displayed using the "latn" numbering system, regardless of what numbering systems may be used for other parts of the formatted date. If the calendar’s year is linked to the solar year (perhaps using leap months), then for that calendar the ‘r’ year will always be at a fixed offset from the ‘u’ year. For the Gregorian calendar, the ‘r’ year is the same as the ‘u’ year. For ‘r’, all field lengths specify a minimum number of digits; there is no special interpretation for “rr”. | ||
quarter | Q | Q | 2 | Numeric: 1 digit | Quarter number/name. |
02 | Numeric: 2 digits + zero pad | ||||
QQQ | Q2 | Abbreviated | |||
QQQQ | 2nd quarter | Wide | |||
QQQQQ | 2 | Narrow | |||
q | q | 2 | Numeric: 1 digit | Stand-Alone Quarter number/name. | |
02 | Numeric: 2 digits + zero pad | ||||
qqq | Q2 | Abbreviated | |||
qqqq | 2nd quarter | Wide | |||
qqqqq | 2 | Narrow | |||
month | M | M | 9, 12 | Numeric: minimum digits | Format style month number/name: The format style name is an additional form of the month name (besides the stand-alone style) that can be used in contexts where it is different than the stand-alone form. For example, depending on the language, patterns that combine month with day-of month (e.g. "d MMMM") may require the month to be in genitive form. See discussion of [month element](#months_days_quarters_eras). If a separate form is not needed, the format and stand-alone forms can be the same. |
MM | 09, 12 | Numeric: 2 digits, zero pad if needed | |||
MMM | Sep | Abbreviated | |||
MMMM | September | Wide | |||
MMMMM | S | Narrow | |||
L | L | 9, 12 | Numeric: minimum digits | Stand-Alone month number/name: For use when the month is displayed by itself, and in any other date pattern (e.g. just month and year, e.g. "LLLL y") that shares the same form of the month name. For month names, this is typically the nominative form. See discussion of [month element](#months_days_quarters_eras). | |
LL | 09, 12 | Numeric: 2 digits, zero pad if needed | |||
LLL | Sep | Abbreviated | |||
LLLL | September | Wide | |||
LLLLL | S | Narrow | |||
l | l | [nothing] | This pattern character is deprecated, and should be ignored in patterns. It was originally intended to be used in combination with M to indicate placement of the symbol for leap month in the Chinese calendar. Placement of that marker is now specified using locale-specific <monthPatterns> data, and formatting and parsing of that marker should be handled as part of supporting the regular M and L pattern characters. | ||
week | w | w | 8, 27 | Numeric: minimum digits | Week of Year (numeric). When used in a pattern with year, use ‘Y’ for the year field instead of ‘y’. |
ww | 08, 27 | Numeric: 2 digits, zero pad if needed | |||
W | W | 3 | Numeric: 1 digit | Week of Month (numeric) | |
day | d | d | 1 | Numeric: minimum digits | Day of month (numeric). |
dd | 01 | Numeric: 2 digits, zero pad if needed | |||
D | D...DDD | 345 | Day of year (numeric). The field length specifies the minimum number of digits, with zero-padding as necessary. | ||
F | F | 2 | Day of Week in Month (numeric). The example is for the 2nd Wed in July | ||
g | g+ | 2451334 | Modified Julian day (numeric). This is different from the conventional Julian day number in two regards. First, it demarcates days at local zone midnight, rather than noon GMT. Second, it is a local number; that is, it depends on the local time zone. It can be thought of as a single number that encompasses all the date-related fields. The field length specifies the minimum number of digits, with zero-padding as necessary. | ||
week day | E | E..EEE | Tue | Abbreviated | Day of week name, format style. |
EEEE | Tuesday | Wide | |||
EEEEE | T | Narrow | |||
EEEEEE | Tu | Short | |||
e | e | 2 | Numeric: 1 digit | Local day of week number/name, format style. Same as E except adds a numeric value that will depend on the local starting day of the week. For this example, Monday is the first day of the week. | |
ee | 02 | Numeric: 2 digits + zero pad | |||
eee | Tue | Abbreviated | |||
eeee | Tuesday | Wide | |||
eeeee | T | Narrow | |||
eeeeee | Tu | Short | |||
c | c..cc | 2 | Numeric: 1 digit | Stand-Alone local day of week number/name. | |
ccc | Tue | Abbreviated | |||
cccc | Tuesday | Wide | |||
ccccc | T | Narrow | |||
cccccc | Tu | Short | |||
period | a | a..aaa | am. [e.g. 12 am.] | Abbreviated | AM, PM May be upper or lowercase depending on the locale and other options. The wide form may be the same as the short form if the “real” long form (eg ante meridiem) is not customarily used. The narrow form must be unique, unlike some other fields. See also Section 9 Parsing Dates and Times. |
aaaa | am. [e.g. 12 am.] | Wide | |||
aaaaa | a [e.g. 12a] | Narrow | |||
b | b..bbb | mid. [e.g. 12 mid.] | Abbreviated | am, pm, noon, midnight May be upper or lowercase depending on the locale and other options. If the locale doesn't the notion of a unique "noon" = 12:00, then the PM form may be substituted. Similarly for "midnight" = 00:00 and the AM form. The narrow form must be unique, unlike some other fields. | |
bbbb | midnight [e.g. 12 midnight] | Wide | |||
bbbbb | md [e.g. 12 md] | Narrow | |||
B | B..BBB | at night [e.g. 3:00 at night] | Abbreviated | flexible day periods May be upper or lowercase depending on the locale and other options. Often there is only one width that is customarily used. | |
BBBB | at night [e.g. 3:00 at night] | Wide | |||
BBBBB | at night [e.g. 3:00 at night] | Narrow | |||
hour | h | h | 1, 12 | Numeric: minimum digits | Hour [1-12]. When used in skeleton data or in a skeleton passed in an API for flexible date pattern generation, it should match the 12-hour-cycle format preferred by the locale (h or K); it should not match a 24-hour-cycle format (H or k). |
hh | 01, 12 | Numeric: 2 digits, zero pad if needed | |||
H | H | 0, 23 | Numeric: minimum digits | Hour [0-23]. When used in skeleton data or in a skeleton passed in an API for flexible date pattern generation, it should match the 24-hour-cycle format preferred by the locale (H or k); it should not match a 12-hour-cycle format (h or K). | |
HH | 00, 23 | Numeric: 2 digits, zero pad if needed | |||
K | K | 0, 11 | Numeric: minimum digits | Hour [0-11]. When used in a skeleton, only matches K or h, see above. | |
KK | 00, 11 | Numeric: 2 digits, zero pad if needed | |||
k | k | 1, 24 | Numeric: minimum digits | Hour [1-24]. When used in a skeleton, only matches k or H, see above. | |
kk | 01, 24 | Numeric: 2 digits, zero pad if needed | |||
j | j | 8 8 AM 13 1 PM | Numeric hour (minimum digits), abbreviated dayPeriod if used | Input skeleton symbol It must not occur in pattern or skeleton data. Instead, it is reserved for use in skeletons passed to APIs doing flexible date pattern generation. In such a context, it requests the preferred hour format for the locale (h, H, K, or k), as determined by the preferred attribute of the hours element in supplemental data. In the implementation of such an API, 'j' must be replaced by h, H, K, or k before beginning a match against availableFormats data. Note that use of 'j' in a skeleton passed to an API is the only way to have a skeleton request a locale's preferred time cycle type (12-hour or 24-hour). | |
jj | 08 08 AM 13 01 PM | Numeric hour (2 digits, zero pad if needed), abbreviated dayPeriod if used | |||
jjj | 8 8 A.M. 13 1 P.M. | Numeric hour (minimum digits), wide dayPeriod if used | |||
jjjj | 08 08 A.M. 13 01 P.M. | Numeric hour (2 digits, zero pad if needed), wide dayPeriod if used | |||
jjjjj | 8 8a 13 1p | Numeric hour (minimum digits), narrow dayPeriod if used | |||
jjjjjj | 08 08a 13 01p | Numeric hour (2 digits, zero pad if needed), narrow dayPeriod if used | |||
J | J | 8 8 | Numeric hour (minimum digits) | Input skeleton symbol It must not occur in pattern or skeleton data. Instead, it is reserved for use in skeletons passed to APIs doing flexible date pattern generation. In such a context, like 'j', it requests the preferred hour format for the locale (h, H, K, or k), as determined by the preferred attribute of the hours element in supplemental data. However, unlike 'j', it requests no dayPeriod marker such as “am/pm” (It is typically used where there is enough context that that is not necessary). For example, with "jmm", 18:00 could appear as “6:00 PM”, while with "Jmm", it would appear as “6:00” (no PM). | |
JJ | 08 08 | Numeric hour (2 digits, zero pad if needed) | |||
C | C | 8 8 (morning) | Numeric hour (minimum digits), abbreviated dayPeriod if used | Input skeleton symbol It must not occur in pattern or skeleton data. Instead, it is reserved for use in skeletons passed to APIs doing flexible date pattern generation. In such a context, like 'j', it requests the preferred hour format for the locale. However, unlike 'j', it can also select formats such as hb or hB, since it is based not on the preferred attribute of the hours element in supplemental data, but instead on the first element of the allowed attribute (which is an ordered preferrence list). For example, with "Cmm", 18:00 could appear as “6:00 in the afternoon”. | |
CC | 08 08 (morning) | Numeric hour (2 digits, zero pad if needed), abbreviated dayPeriod if used | |||
CCC | 8 8 in the morning | Numeric hour (minimum digits), wide dayPeriod if used | |||
CCCC | 08 08 in the morning | Numeric hour (2 digits, zero pad if needed), wide dayPeriod if used | |||
CCCCC | 8 8 (morn.) | Numeric hour (minimum digits), narrow dayPeriod if used | |||
CCCCCC | 08 08 (morn.) | Numeric hour (2 digits, zero pad if needed), narrow dayPeriod if used | |||
minute | m | m | 8, 59 | Numeric: minimum digits | Minute (numeric). Truncated, not rounded. |
mm | 08, 59 | Numeric: 2 digits, zero pad if needed | |||
second | s | s | 8, 12 | Numeric: minimum digits | Second (numeric). Truncated, not rounded. |
ss | 08, 12 | Numeric: 2 digits, zero pad if needed | |||
S | S+ | 3456 | Fractional Second (numeric). Truncates, like other numeric time fields, but in this case to the number of digits specified by the field length. (Example shows display using pattern SSSS for seconds value 12.34567) | ||
A | A+ | 69540000 | Milliseconds in day (numeric). This field behaves exactly like a composite of all time-related fields, not including the zone fields. As such, it also reflects discontinuities of those fields on DST transition days. On a day of DST onset, it will jump forward. On a day of DST cessation, it will jump backward. This reflects the fact that is must be combined with the offset field to obtain a unique local time value. The field length specifies the minimum number of digits, with zero-padding as necessary. | ||
sep. | (none def., see note) | Time separator. Note: In CLDR 26 the time separator pattern character was specified to be COLON. This was withdrawn in CLDR 28 due to backward compatibility issues, and no time separator pattern character is currently defined. Like the use of "," in number formats, this character in a date pattern is replaced with the corresponding number symbol which may depend on the numbering system. For more information, see Part 3: Numbers, Section 2.3 Number Symbols. | |||
zone | z | z..zzz | PDT | The short specific non-location format. Where that is unavailable, falls back to the short localized GMT format ("O"). | |
zzzz | Pacific Daylight Time | The long specific non-location format. Where that is unavailable, falls back to the long localized GMT format ("OOOO"). | |||
Z | Z..ZZZ | -0800 | The ISO8601 basic format with hours, minutes and optional seconds fields. The format is equivalent to RFC 822 zone format (when optional seconds field is absent). This is equivalent to the "xxxx" specifier. | ||
ZZZZ | GMT-8:00 | The long localized GMT format. This is equivalent to the "OOOO" specifier. | |||
ZZZZZ | -08:00 -07:52:58 |
The ISO8601 extended format with hours, minutes and optional seconds fields. The ISO8601 UTC indicator "Z" is used when local time offset is 0. This is equivalent to the "XXXXX" specifier. | |||
O | O | GMT-8 | The short localized GMT format. | ||
OOOO | GMT-08:00 | The long localized GMT format. | |||
v | v | PT | The short generic non-location format Where that is unavailable, falls back to the generic location format ("VVVV"), then the short localized GMT format as the final fallback. | ||
vvvv | Pacific Time | The long generic non-location format. Where that is unavailable, falls back to generic location format ("VVVV"). | |||
V | V | uslax | The short time zone ID. Where that is unavailable, the special short time zone ID unk (Unknown Zone) is used. Note: This specifier was originally used for a variant of the short specific non-location format, but it was deprecated in the later version of this specification. In CLDR 23, the definition of the specifier was changed to designate a short time zone ID. | ||
VV | America/Los_Angeles | The long time zone ID. | |||
VVV | Los Angeles | The exemplar city (location) for the time zone. Where that is unavailable, the localized exemplar city name for the special zone Etc/Unknown is used as the fallback (for example, "Unknown City"). | |||
VVVV | Los Angeles Time | The generic location format.
Where that is unavailable, falls back to the long localized GMT format ("OOOO"; Note: Fallback is only necessary with a GMT-style Time Zone ID, like Etc/GMT-830.) This is especially useful when presenting possible timezone choices for user selection, since the naming is more uniform than the "v" format. | |||
X | X | -08 +0530 Z |
The ISO8601 basic format with hours field and optional minutes field. The ISO8601 UTC indicator "Z" is used when local time offset is 0. (The same as x, plus "Z".) | ||
XX | -0800 Z |
The ISO8601 basic format with hours and minutes fields. The ISO8601 UTC indicator "Z" is used when local time offset is 0. (The same as xx, plus "Z".) | |||
XXX | -08:00 Z |
The ISO8601 extended format with hours and minutes fields. The ISO8601 UTC indicator "Z" is used when local time offset is 0. (The same as xxx, plus "Z".) | |||
XXXX | -0800 -075258 Z |
The ISO8601 basic format with hours, minutes and optional seconds fields.
The ISO8601 UTC indicator "Z" is used when local time offset is 0. (The same as xxxx, plus "Z".) Note: The seconds field is not supported by the ISO8601 specification. | |||
XXXXX | -08:00 -07:52:58 Z |
The ISO8601 extended format with hours, minutes and optional seconds fields.
The ISO8601 UTC indicator "Z" is used when local time offset is 0. (The same as xxxxx, plus "Z".) Note: The seconds field is not supported by the ISO8601 specification. | |||
x | x | -08 +0530 +00 |
The ISO8601 basic format with hours field and optional minutes field. (The same as X, minus "Z".) | ||
xx | -0800 +0000 |
The ISO8601 basic format with hours and minutes fields. (The same as XX, minus "Z".) | |||
xxx | -08:00 +00:00 |
The ISO8601 extended format with hours and minutes fields. (The same as XXX, minus "Z".) | |||
xxxx | -0800 -075258 +0000 |
The ISO8601 basic format with hours, minutes and optional seconds fields. (The same as XXXX, minus "Z".) Note: The seconds field is not supported by the ISO8601 specification. | |||
xxxxx | -08:00 -07:52:58 +00:00 |
The ISO8601 extended format with hours, minutes and optional seconds fields. (The same as XXXXX, minus "Z".) Note: The seconds field is not supported by the ISO8601 specification. |