File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Java converting unix time to date different on each computer,why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java converting unix time to date different on each computer,why?" Watch "Java converting unix time to date different on each computer,why?" New topic
Author

Java converting unix time to date different on each computer,why?

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
i have weird situation i have simple code that looks like this :



some computers im getting : 21.06.2011 15:43 and this is the date that im expecting to get and its fine .
but on other pc's im getting :21.06.2011,18:43 i dont know why im getting this date. what can be wrong in the pc or java configuration that gives me this ?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11256
    
  16

My guess would be something with time zone setting, but i couldn't tell you where to look specifically.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

The computers have been configured with different time ones. Make all the time zones the same or specify the time zone for your SimpleDateFormat.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Nick Jariwala
Greenhorn

Joined: Jun 01, 2011
Posts: 8


Use this format and you'll see the timezone in the output.

-Nick
http://www.the-tech-talent.com
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
well strange thing is happening , in some pc's it fixed the problem and in some it doesn't do any change .
they all set into same timezone .
what else can it be ?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Meir Yan wrote:well strange thing is happening , in some pc's it fixed the problem and in some it doesn't do any change .
they all set into same timezone .
what else can it be ?


Since you don't say how far out the rogue PCs are then I can only suggest a long shot - daylight saving time?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java converting unix time to date different on each computer,why?