[threeten-dev] Possible addition of pattern letters in CLDR
Dan Chiba
dan.chiba at oracle.com
Wed Dec 19 15:14:32 PST 2012
Hi Yoshito-san,
I think JSR-310 could look at the shortest GMT format when the CLDR
requirements are sorted out and its spec becomes available. At this
point, best we can do is to agree on the intent to revisit once the CLDR
spec is ready for implementation in the future. It would be adequate to
document the chance of enhancements to follow CLDR updates.
For fractional seconds, I think JSR-310 should use the number formatting
conventions if CLDR updates the syntax to incorporate them. Imho
conformance is far more important than whether we use 'f' or number
format syntax.
Hi Stephen,
Would you agree to do "HH:mm:ss.SSS###" for printing 3 to 6 fractional
digits, like number formatting?
Regards,
-Dan
On 12/18/2012 10:06 PM, yoshito_umaoka at us.ibm.com wrote:
> > 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