Dates and Times in ICUDatesDifferent locales represent dates differently. Dates should be
stored in a generic form in an internationalized application and
formatted in the locale appropriate format just prior to being displayed
to the user. ICU
(International Components for Unicode) has a rich set of locale-based
date formatting services. More information can be found at ICU
Date Formatting. The following example illustrates how to format
a short date for the
Often, non-internationalized applications include hard coded day
and month names (i.e. "Sunday", "January", etc).
If ICU date formatting is used, these can be removed altogether.
ICU's locale-specific date formats correctly display the translated
equivalents of days and month names. TimesAs with dates, times should be stored using a generic format throughout the internationalized source code. Times should be formatted according to the user's locale just prior to being displayed to the user. A general discussion of ICU's locale specific time formatting can be found at ICU Formatting Dates and Times Overview. ICU also provides support for dealing with multiple time zones
at ICU Time Zones. |