JDK-4177450 : TimeZone set wrong if no country
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_2.5
  • CPU: generic,sparc
  • Submitted: 1998-09-30
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2fcsFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description

Name: bb33257			Date: 09/29/98


The VM code which determines the default TimeZone doesn't work
if there is no country.  For example,

  export LC_ALL=en

causes the TimeZone to be set to GMT-7 instead of PST.  This
affects the way Dates are displayed etc.
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2fcs FIXED IN: 1.2fcs INTEGRATED IN: 1.2fcs
14-06-2004

EVALUATION alanl@eng: Fixed for JDK 1.2 FCS M. norbert.lindenberg@Eng 1998-09-30
11-06-2004

WORK AROUND Name: bb33257 Date: 09/29/98 Either: 1. Set the host locale to include a country, e.g. instead of setenv LC_ALL=en, do setenv LC_ALL=en_US 2. Set the timezone on the command line explicitly: java -Duser.timezone=America/Los_Angeles ... ======================================================================
11-06-2004

SUGGESTED FIX The problem is in java_props_md.c (both solaris and win32 flavors). Here are the changes required to the solaris java_props_md.c; win32 is exactly analogous. Another issue which should be investigated is whether or not the country is ever supposed to be blank -- there may be a problem there. *** /tmp/geta442 Tue Sep 29 17:46:08 1998 --- java_props_md.c Tue Sep 29 17:46:01 1998 *************** *** 269,275 **** * * If successful, 'match' will be >= 0. */ - if (sprops.region != NULL) { i = 0; while (i < timezone_map_length && timezone_map[i].offset < offset) { --- 269,274 ---- *************** *** 282,288 **** * recognized as PST, even though there is no JA entry for * GMT-8. */ if (((timezone_map[i].country == NULL) ! || (strcmp(timezone_map[i].country, sprops.region) == 0)) && (timezone_map[i].hasDST == kAny || timezone_map[i].hasDST == hasDST)) { match = i; --- 281,288 ---- * recognized as PST, even though there is no JA entry for * GMT-8. */ if (((timezone_map[i].country == NULL) ! || (sprops.region != NULL ! && (strcmp(timezone_map[i].country, sprops.region) == 0))) && (timezone_map[i].hasDST == kAny || timezone_map[i].hasDST == hasDST)) { match = i; *************** *** 290,296 **** } ++i; } - } if (match >= 0) { std_timezone = timezone_map[match].zone; --- 290,295 ---- alan.liu@eng 1998-09-29
29-09-1998