• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AIX Timezone problem, Java showing one hour less

 
Raghu Devatha
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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.?



 
Adam Michalik
Ranch Hand
Posts: 128
  • 0
  • Mark post as helpful
  • send pies
  • 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: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Paul Clapham
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • 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
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh! I guess my point was that it looks old and maybe there is a later version.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not related to Performance. Moving to Java In General
 
Mike Simmons
Ranch Hand
Posts: 3028
10
  • 0
  • Mark post as helpful
  • send pies
  • 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: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic