Bug 490015

Summary: TZ not calculated properly in JDK for location Americas/Raleigh(DST not recognized)
Product: [Fedora] Fedora Reporter: Jay Howell <jhowell>
Component: java-1.6.0-openjdkAssignee: Lillian Angel <langel>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dbhole, iivan, langel, lkundrak, mjw, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-15 18:43:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jay Howell 2009-03-12 20:50:09 UTC
Description of problem:

When using java.util.Date functions, the TZ is not automatically calculated for Raleigh locations.  

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  Configure Rawhide to use Raleigh as a location for time zone.
2.  Write a java app that does System.out.println( new java.util.Date());
3.  
4.  Went in and looked at the Timezone object and did 


  
Actual results:
It will return GMT-5 during Daylight Savings time 

Expected results:
it should return GMT-4

Additional info:
TimeZone.getTimeZone("America/Raleigh").getDSTSavings(), it returns 0.

The work around is to use a different major city in the same time zone.  When I change my Platform location to be New York it works ok.  I can also fix this by adding System.setProperty("user.timezone", "America/New_York"); in the beginning of my code.  

So it seems like a mismatch of TZ between the platform and the JVM.

Comment 1 Omair Majid 2009-03-19 15:25:35 UTC
Hi Jay,

I upgraded to rawhide from f10, and I cant find a way to use Raleigh as the local timezone. So i cant reproduce the issue :(. I cant find an entry for Raleigh in system-config-date, nor an file in /usr/share/zoneinfo.

Printing TimeZone.getTimeZone("America/Raleigh") in Java produces:
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

The timezone information is provided the tzdata package for the system and by tzdata-java package for java. They are built form the same set of sources, so there shouldnt be a mismatch.

Comment 2 Ioana Ivan 2009-03-25 04:37:14 UTC
I think America/New_York is the correct time zone for Raleigh. The problem is that java looks for time zone information in /etc/sysconfig/clock, where the ZONE parameter is specified as America/New York instead of America/New_York (see https://bugzilla.redhat.com/show_bug.cgi?id=489586)

Comment 3 Ioana Ivan 2009-05-15 18:43:40 UTC

*** This bug has been marked as a duplicate of bug 489586 ***