Localized GMT Format

Tickets

#3665 Additional time zone offset second field

#5382 Add short localized GMT format

Requirements

Current Implementation

In CLDR 22, elements used for localized GMT format are below:

Proposed Changes

Below are the high level overview of the changes in this proposal

With above change, root.xml would be changed from

Old:

 <hourFormat>+HH:mm;-HH:mm</hourFormat>

New:

 <gmtOffsetPattern type=”h”>+H;-H</gmtOffsetPattern>

 <gmtOffsetPattern type=”hm”>+H:m;-H:m</gmtOffsetPattern>

 <gmtOffsetPattern type=”hms”>+H:m:s;-H:m:s</gmtOffsetPattern>

 <gmtOffsetSeparator>:</gmtOffsetSeparator>

The table below illustrates the behavior of long / short format, with the root data above.

UTC Offset Width Output Comment
-8:00:00 long GMT-08:00 The negative pattern from <gmtOffsetPattern type=”hm”>, interpret ‘H’ as fixed 2 digits hour, replace ‘:’ with <gmtOffsetSeparator>
  short GMT-8 The negative pattern from <gmtOffsetPattern type”h”>
-8:30:00 long GMT-08:30 The negative pattern from <gmtOffsetPattern type=”hm”>, interpret ‘H’ as fixed 2 digits hour, replace ‘:’ with <gmtOffsetSeparator>
  short GMT-8:30 The negative pattern from <gmtOffsetPattern type=”hm”>, interpret ‘H’ as variable width hour, replace ‘:’ with <gmtOffsetSeparator>
-8:23:45 long GMT-08:23:45 The negative pattern from <gmtOffsetPattern type=”hms”>, interpret ‘H’ as fixed 2 digits hour, replace ‘:’ with <gmtOffsetSeparator>
  short GMT-8:23:45 The negative pattern from <gmtOffsetPattern type=”hms”>, interpret ‘H’ as variable width hour, replace ‘:’ with <gmtOffsetSeparator>

Design considerations

Open Issues

  1. Distinction of H and HH in the current locale data.

Some locales currently use single “H” in <hourFormat>.

 <hourFormat>+H:mm;-H:mm</hourFormat> (cs.xml)

 <hourFormat>+H.mm;-H.mm</hourFormat> (fi.xml)

This proposal is trying to set a new assumption that “long” format to be practically fixed length, and long format always place leading zero for single digit hour value. If this assumption is not acceptable by these locales, then the design must be changed to allow “HH” or “H” in <gmtOffsetPattern> element, then “short” format to interpret “HH” as “H” (opposite way). However, I don’t think this is the case.

  1. Needs for long/short message pattern?

Although, ticket #5382 mentioned about offset part of localized GMT format, some locales may want to have two <gmtFormat> data in different length. For example,

 <gmtFormat>Гриинуич{0}</gmtFormat> (bg.xml)

 <gmtFormat>গ্রীনিচ মান সময় {0}</gmtFormat> (bn.xml)

There are some locales using relatively long patterns. If long/short distinction is given, these locales may want to provide shorter format such as “UTC{0}”.

  1. Impacts in CLDR ST

Because of another level of abstraction (separator, actual pattern width by context), this proposal may need a little bit more work on CLDR ST.