JDK-4069879 : Timezone: NST & Locale: NZ
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 1.1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-08-05
  • Updated: 1997-10-23
  • Resolved: 1997-10-23
Related Reports
Duplicate :  
Description

Name: rlT66838			Date: 08/05/97


By the way I am using Solaris Intel not SPARC.

1) SimpleTimeZone (text.util)

The built in simple time zone for NST seems to have incorrect
daylight savings. ie (java.util.TimeZone):

 SimpleTimeZone( '+1200', APRIL,1,SUNDAY, 2am,
                          OCTOBER,-1, SUNDAY, 2am );

In fact looking in /usr/share/lib/zoneinfo/australasia at
the NZ definition:

 
###############################################################################
 
# New Zealand
 
# Rule  NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
Rule    NZ      1990    max     -       Oct     Sun>=1  2:00s   1:00    D
Rule    NZ      1990    max     -       Mar     Sun>=15 2:00s   0       S


(Wouldn't it be good if Java could pick up these time zone files?)

2) Locale for New Zealand. (java.util)

Also their is no Locale for New Zealand, but their is a time
zone; their needs to be two Locale's for New Zealand:

	Locale_en_NZ	: English (New Zealand)
	Locale_mi_NZ	: Maori (New Zealand)

The New Zealand (en_NZ) Locale is very simular to the UK except
we use dollars. I have attempted to make my own Resource files
if you want them.

3) TimeZone and Formatting. (java.text)

Because there is no Locale for New Zealand in JDK1.1.1 these
functions don't work out to well. But I think there is also a
bug even if the Locale's are added, this is because the time
zone names fail a string match; the SimpleTimeZone is called
NST but in Unix(Solaris) there is only NZST and NZDT and these
are correct; their is no NST. To prove this my System properties
gives me a timezone of NZST. Passing in NST into

	java.text.DateFormatSymbols.getZoneIndex(String)

Will compare with fields [2] & [4] which contains 'NZST' and
'NZDT' thus the compare will fail (not NST). I could be wrong
here?
company - R.A.Ward Ltd. , email - ###@###.###
======================================================================

Comments
WORK AROUND Name: rlT66838 Date: 08/05/97 Add Locales ( or allow programmer even more control ) since a lot of packages in "java.text" look in the "java.text.resources" package by default, yet we are told not to modify or put things in here as it should be treated as a private package. However we need the following Locale objects: java.text.resources.LocaleElements_en_NZ java.text.resources.DateFormatZoneDate_en_NZ And the Maori: java.text.resources.LocaleElements_mi_NZ java.text.resources.DateFormatZoneDate_mi_NZ English is the largest spoken language in New Zealand, and that includes Maori people. ======================================================================
11-06-2004