[threeten-dev] Possible addition of pattern letters in CLDR

yoshito_umaoka at us.ibm.com yoshito_umaoka at us.ibm.com
Tue Dec 18 22:06:23 PST 2012


> May I ask the status of the shortest GMT format? When could it be 
> implemented by vendors?

LDML defines "localized GMT offset format" right now.
This format is created by following two elements:

root.xml

<hourFormat>+HH:mm;-HH:mm</hourFormat>
<gmtFormat>GMT{0}</gmtFormat>

This is pretty similar to offset based time zone ID used by Java.
In LDML, this is localizable and used as final fallback of time zone 
display name.

For example, in Finnish (fi.xml)

<hourFormat>+H.mm;-H.mm</hourFormat>
<gmtFormat>UTC{0}</gmtFormat>

The shortest localized GMT format we're currently discussing in CLDR 
project is based on this format, but shortest possible form. For example, 
"GMT-05:00" might be shortened to "GMT-5" (no leading zero, no minutes if 
zero).

Also, LDML specification currently does not support non-zero seconds 
offset. So, we're currently trying to sort out the requirements and add 
necessary data structure to support them.

> As for punctuations, I think comma and dot are already locale 
> sensitive for number formatting, so it would be easy for people to 
> understand how the locale sensitive punctuations for date time 
> formatting work. Because the predefined formatting patterns for 
> locales have the separators for date and time fields and they are 
> commonly used, it doesn't seem to be an issue that there is no 
> locale sensitive pattern letter for them. So I think I am only 
> interested in the decimal separator for fractional seconds. 
> Alternatively, if CLDR had predefined locale sensitive patterns with
> fractional seconds, that could also be a solution. For instance, a 
> predefined common pattern to print hour, minute, second and 
> millisecond for the US locale may look like this:
> 
>                         <dateFormatItem id="HmsS">HH:mm:ss.SSS</
> dateFormatItem>

If forwarded a note to the CLDR development list and got a feedback about 
'f'.
Stephen pointed out 'f' can be used for min/max decimal digits. However, 
Mark Davis(google) suggested if JSR-310 can use number format pattern like 
syntax. For example,

HH:mm:ss.SSS###

Above pattern indicates minimum 3 /up to 6 decimal digits. Such syntax 
might be easier to understand and a little bit more flexible (can set 
maximum digits, not only for 9). I personally agree that above syntax is 
better than "HH:mm:ss.ffSSS".

-Yoshito


More information about the threeten-dev mailing list