• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving the time

 
Per Lovdinger
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem with retrieving the time for a unix application.
Problem:
- 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
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Calendar class has a setTimeZone() method that you may be able to use.

Bosun

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic