• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Daylight savings time problem

 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a little analog clock app that I wrote because the flavor of Linux I'm running lacks one.

It's been running for years but this year it didn't get the time change and it reports the time zone as GMT-08:00 rather than PDT.

To complicate matters if I run it remotely from a computing cluster it works fine.

I'm at a loss to figure out what the problems is.

None of these systems have the Java property user.timezone set.

I get the time as a string with



And as hr, min, sec for drawing the clock hands:


Any ideas what I'm missing?

Joe
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Areeda wrote:It's been running for years but this year it didn't get the time change and it reports the time zone as GMT-08:00 rather than PDT.


Have you changed Java versions? What you have looks reasonable, but the "zzz" is notoriously inconsistent (basically, timezones, and "what we call them" is inconsistent too).

I am, however, very surprised that you're getting GMT-8:00 for Pacific time when DST is in progress.

You might try something like
time.setTimezone("US/Pacific");
and give it another try. However, that doesn't solve your problem. Somehow, the JVM doesn't seem to be working out that your local timezone is actually that (which it should be); and I'm afraid there could be a few reasons.

Winston
 
Joe Areeda
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Winston,

You've pointed me in the right direction.

Oracle's jdk1.7.0_45 works
Whereas openjdk-1.7.0.51 does not.

I'll see if Google can help me figure out how OpenJDK figures out what time zone it's in.

Joe
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Areeda wrote:Thanks Winston


You're most welcome.

I'll see if Google can help me figure out how OpenJDK figures out what time zone it's in.


And if you do find it, please post. It might be useful to someone else.

Thanks

Winston
 
Joe Areeda
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:
And if you do find it, please post. It might be useful to someone else.


There seem to be bug reports going back to 2006 about this but none of them really on point. Resolutions are mostly "miraculously fixed with last update".

I posted to the Scientific Linux list (RHEL derivative managed at Fermilab). We'll see if they come back with anything.

Joe
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic