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

yoshito_umaoka at us.ibm.com yoshito_umaoka at us.ibm.com
Tue Dec 4 20:36:48 PST 2012


public static DateTimeFormatter pattern(String pattern) is quite 
interesting. It mentions -

"The pattern string is also similar, but not identical, to that defined by 
the Unicode Common Locale Data Repository (CLDR)."

With my quick review, following pattern letters are not available in LDML 
specification

   n       nano-of-second              number/fraction   987654321
   N       nano-of-day                 number/fraction   1234000000
   I       time-zone ID                zoneID America/Los_Angeles

I think all of these make sense. In longer term, I don't want to see 
different pattern definition across similar implementations. If these are 
final, I'm happy to work on CLDR side and propose these pattern letters 
registered in the LDML specification.

   X       zone-offset 'Z' for zero    offset-X          Z; -0800; -08:00;

This one is tricky. We recently added ISO 8601 style offset format in the 
LDML specification with "ZZZZZ"
LDML "ZZZZZ" formats UTC to "Z" and non-UTC offsets using longer format 
such as "-08:00" (with colon).

   Z       zone-offset                 offset-Z          +0000; -0800; 
-08:00;

On the other hand, pattern letter "Z" in the LDML specification uses the 
following definition-

Z, ZZ, ZZZ -> RFC822 format
ZZZZ -> Localized GMT format, such as "GMT-08:00" "UTC-08:00"...


I personally think CLDR may introduce pattern X, supporting both 
long/short offset format, and deprecate "ZZZZZ" (or simply leave it as an 
alias definition).

For offset format, CLDR community is now seeking for shorter offset format 
support. For example, "GMT-3" instead of "GMT-03:00".

Anyway, I'll consult with CLDR community members to find out if CLDR can 
provide compatible definitions for these too.

Thanks,
Yoshito Umaoka (ICU Project at IBM)





More information about the threeten-dev mailing list