• Post Reply Bookmark Topic Watch Topic
  • New Topic

Daylight savings time problem  RSS feed

 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • 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
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • 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
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!