Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17566 converting date time #3830

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions docs/site/TEMP-TEXT-FILES/date-time-names.txt

Large diffs are not rendered by default.

266 changes: 266 additions & 0 deletions docs/site/TEMP-TEXT-FILES/date-time-patterns.txt

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions docs/site/TEMP-TEXT-FILES/date-time-symbols.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Date/Time Symbols
Symbols is a required topic to work in Date/Time Patterns
More details on date/time symbols and patterns may be found in the Spec Date Field Symbol Table.
About Symbols
Dates and times are formatted using patterns, like "mm-dd". Within these patterns, each field, like the month or the hour, is represented by a sequence of letters (“pattern characters”) in the range A–Z or a–z. For example, sequences consisting of one or more ‘M‘ or ‘L‘ stand for various forms of a month name or number.
When the software formats a date for your language, a value will be substituted for each field, according to the following table. Examples of the pattern usage you may see in an every day use may be on the lock screen on a mobile device showing the date or time, or as a date stamp on an email.
Notice in the table below that there are different pattern characters for standalone and formatting. For example M to indicate the formatting and L to indicate the standalone month names.
Make sure you understand the difference between standalone and formatting patterns and use the appropriate symbols in patterns. See when to use standalone vs. formatting in Date and Time patterns.
Symbol Meaning English example Special note Usage in pattern example
G era AD, BC This symbol also covers era names and abbreviations for non-Gregorian calendars, such as Japanese. y G = 1999 AD
y
yy year 1987 use y to show as many digits as necessary (987, 2017)
Use yy to always show year in two digits (87, 17, 09). M/d/y = 9/5/2019 M/d/yy = 9/5/19
M month September Used in patterns to reference use of Formatted month names. MMMM d, y = September 5, 2019
L month September Used in patterns to reference use of Standalone month names.
See below under Stand-Alone vs Format Styles for the difference between M and L. LLLL d, y =September 5, 2019
E Day of week Tuesday Used in patterns to reference use of Formatted weekday names. EEEE, MMMM d, y = Sunday, September 5, 2009
c Day of week Tuesday Used in patterns to reference use of Standalone weekday names.
See below under Stand-Alone vs Format Styles for the difference between E and c. ccc = Sun
d day
h
H
K
k Hour 12 h- hour in a 12 hour clock
H-hour in a 24 hour clock system using 0-23
K -12 hour cycle using 0 through 11
k - 24 hour cycle using 1 though 24 h:mm a = 3:25 PM
HH:mm = 15:25
K:mm a = 0:25 AM
kk:mm = 24:25
m minute 49 hh:mm a = 03:25 PM
s second 49 h:mm:ss = 3:25:01 PM
a
b
B day period AM noon in the morning a- AM or PM b-am, noon, pm, or midnight
B-"in the morning", "in the evening" (see Day period names)
ONLY used with "h" or K" for all a, b and B See date/time patterns about flexible time formats even if your language does not use 12-hour time clock Also see date/time day period patterns. h:mm a = 3:25 PM
h:mm b = 12:00 noon
h:mm B= 3:25 in the afternoon
z / v timezone Pacific Time, Paris Time Don't change v to z or vice versa; just leave either z or v as in English. h a – h a v = 5 AM – 5 PM GMT
' If you want a sequence of one or more real letters A–Z or a–z within a pattern, you need to put it in single quotes, such as 'ta'. This is because l etters included in a format have special meaning.
For a real single quote, use '' (that is, two adjacent ' characters). German example for skeleton h h 'Uhr' a = 1 Uhr PM
Q Quarter (a concept of 3 months period) These are calendar quarters not fiscal quarters.
4 Quarters in United States for example would be Jan-Mar, Apr-June, July-Sep, Sep-Dec. Also see 💡 Translation Tips below QQQ y = Q3 1999
Symbol Examples Meaning
M 3, 11 Numeric form, at least 1 digit and without leading zero.
MM 03, 11 Number form, 2 digits with leading zero if necessary
MMM Dec Abbreviated form
MMMM December Full form
MMMMM D Narrow form - only used in where context makes it clear, such as headers in a calendar. Should be one character wherever possible.
💡Translation Tips
The symbols using characters a-z and A-Z are special placeholders; they stand for date or time fields. They are NOT real characters.
For example, 'y' stands for a numeric year and will be replaced by a value like '1998'. DO NOT "translate" the placeholders; for example, don't change 'y' to 'j' even though in your language the word for "year" starts with a "j".
Any "real" characters need to be quoted. For example, 'g' in a real character in this example pattern: EEE, yyyy. 'g'. dd. MMM
If your language doesn't have a concept of "Quarters", use a translation that describes the concept "three-month period" rather than “quarter-of-a-year”.
Symbol Length
The number of letters in a field indicates the format.
The number of letters used to indicate the format is the same for all date fields EXCEPT for the year. (See table above for y and yy).
The following are the available field lengths, and their meanings:
The longer forms are only relevant for the fields that are non-numeric, such as era names, month names, day of the week, and am/pm, etc...
Standalone vs. Format Styles
This section is relevant to When to use standalone vs. Formatting in date/time patterns.
Some languages use two different forms of strings (standalone and format) depending on the context. Typically the standalone version is the nominative form of the word, and the format version is in the genitive (or related form).
Two different characters are used:
Field Format Standalone
Month M L
Day of the Week E c
💡 Translation Tips
Standalone and Format names must be coordinated with the format strings. See When to use standalone vs. Formatting in date/time patterns.
If your language uses two different form, be sure to provide the correct forms under Standalone and Formatting. For example in Brazilian Portuguese
"Dezembro" for December when standing alone; thus use LLLL
"Dezembru" when referencing December with a date (e.g. to mean "the nth day of that month"); thus, use MMMM
Then, make sure you use the intended forms by using the correct symbol (e.g. LLLL stand-alone form or MMMM format forms).
If your language formats months differently with vowels, eg "14 de gener de 2008" but "14 d'abril de 2008"; the stand-alone and format versions of the months should be as follows; in this case the format strings should not have the extra "de" before the month:
Format Month Stand-Alone Month
de gener gener
d'abril abril
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table-like text --> md table

These days, standalone names should not be used merely to provide capitalized forms. There are other solutions for capitalizing date symbols which provide finer control over capitalization, see capitalization guidelines.
Examples:
Nominative/standalone (LLLL) vs genitive/format (MMMM):
Format Example1 Example2
LLLL Dezembro Dez.
d MMMM 1 Dezembru 1 Dez.
MMMM d yy Dezembru 1 1953 1 Dez. 53
Precede months with de or d’ - coordinate with the formats strings, which can't have the extra "de" before the month:
Format String Date Result
LLLL 2008-1-14 gener
2008-4-14 abril
d MMMM 'de' y 2008-1-14 14 de gener de 2008
2008-4-14 14 d’abril de 2008
Unicode copyright
5 changes: 5 additions & 0 deletions docs/site/TEMP-TEXT-FILES/date-time.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Date & Time
Date & Time terminology
Date/Time Names
Date/Time Patterns
Date/Time Symbols
9 changes: 9 additions & 0 deletions docs/site/TEMP-TEXT-FILES/date-times-terminology.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Date & Time terminology
This topic is in-progress and and not finalized yet for use.
Following are terminology and definitions that are used for Date and Time structure and data in CLDR. The terminology used in CLDR have dependency on LDML Spec #35 and names of methods and objects in ICU.
Terminology Definition Examples
Symbols or Pattern characters or placeholder symbol The ASCII-range letters used in patterns, character in a placeholder field G, y, M, d
pattern fields or placeholder fields A sequence of one or more of the above used in a pattern sequence of characters that is replaced in a pattern at runtime, like MMM, {1}, "###" (in numbers) MMM E
Spec: Elements ICU: textual forms as symbols The specific localized values that replace a pattern fields depending on the date Monday or January, or 7.
calendar fields The abstract calendar type that is represented by the letters era or year.
calendar field “ names" The localized names for each type of calendar field “era” or “year”:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/site/images/date-time/era.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/site/translation/date-time.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Date & Time
---

# Date & Time

- [Date & Time terminology](https://cldr.unicode.org/translation/date-time/date-times-terminology)
- [Date/Time Names](https://cldr.unicode.org/translation/date-time/date-time-names)
- [Date/Time Patterns](https://cldr.unicode.org/translation/date-time/date-time-patterns)
- [Date/Time Symbols](https://cldr.unicode.org/translation/date-time/date-time-symbols)

![Unicode copyright](https://www.unicode.org/img/hb_notice.gif)
Loading