• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

AIX Timezone problem, Java showing one hour less

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The output of the program and the shell command 'Date' are differed by one hour, did anybody face this problem. What can be the solution.?



 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen some announcements concerning updates in JRE/JDK timezones on Sun's site. Try to check with the newest version (possibly newest JDK 6 version).
 
Raghu Devatha
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adam Michalik wrote:I've seen some announcements concerning updates in JRE/JDK timezones on Sun's site. Try to check with the newest version (possibly newest JDK 6 version).




Sorry, but I am using IBM Java
 
author & internet detective
Posts: 41093
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Raghu Devatha wrote:Sorry, but I am using IBM Java


What version? (or the JDK or more likely of WebSphere) When was it last patched?
 
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:What version? (or the JDK or more likely of WebSphere) When was it last patched?



Looks to me like the answers to those questions were already in the original post:

 
Jeanne Boyarsky
author & internet detective
Posts: 41093
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doh! I guess my point was that it looks old and maybe there is a later version.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not related to Performance. Moving to Java In General
 
Master Rancher
Posts: 4197
57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ragu, one thing is not clear from your post: between Java's output and the system "date" output, which one (if any) is actually correct? Is this a problem with Java, or a problem with how the date command is displaying the time?

I'm suspicious to see that $TZ is "IST-5:30IST" - that looks nonsensical to me. IST should be equivalent to GMT+5:30, not IST-5:30. What does that even mean? Maybe that just means that whoever came up with the TZ string value was a poor communicator, or maybe it indicates deeper technical issues.

I see discussion of a similar issue here. A good suggestion is to compare the output of "date" vs "date -u". If the difference is 5:30, good, but if it's 6:30, the problem is in your AIX system, not Java.
 
Raghu Devatha
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike, System 'date' is giving me the correct time. I thought it was a problem with Java.

I too suspect the way my TZ variable is set. The link you suggested was helpful. The news is date and date -u gives me a difference of 6.30, so , should be problem with my AIX machine. I will post the solution after I get

Thanks a lot for your help,

-Raghu
 
Raghu Devatha
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Daylight Savings Time option was enabled for IST but IST do not use any DST. Disabling the DST option and correcting TZ variable value helped.

Java and date are now showing the same time. 'date' and 'date -u' results in a 5.30hrs difference.

Thanks a lot Mike Simmons.
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic