• 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

GregorianCalendar()

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Java 1.4.2 and on trying to get the current time through public GregorianCalendar(TimeZone zone) I am getting a one hour time lag with respect to the system/local time. Does anyone have any idea about this?

Thanks!
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is possible this is related to the changing of the daylight savings clock change dates. I know there is a more technical word for that,

A couple years ago, the date when the clocks were supposed to be turned ahead in the spring was moved up, so any existing timezone rule data would still perform adjustments using the old days, making the time it returned be one hour ahead, or behind between the intervals of the old daylight savings day and the new one.

The solution is to update the timezone data files, but the official fix to the timzeone rules files for daylight savings adjustments in Java was not available to java until after Java 1.5.0 update 11 or so. do, or if it is even possible and would work.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using the the java.util.Date.
That should bypass the locale settings.
I assume, since you have mentioned, current time as per system time, you are not interested in DST and other locale related stuff.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic