This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes retrieving the time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "retrieving the time " Watch "retrieving the time " New topic

retrieving the time

Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
I have a problem with retrieving the time for a unix application.
- The date on Unix is set to GMT time (for example 12.00) - (without
adjustment for daylight)
- When I get the time with
Date date = new java.util.Date(System.currentTimeMillis());
System.out.println("Gmt util.Date =" + date);
I get the 11.00, (I expect 12.00)
What is wrong ?

cheers Per

Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The Calendar class has a setTimeZone() method that you may be able to use.


So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: retrieving the time
It's not a secret anymore!