Solved

today.getTime() is 1 hour behind

Posted on 2007-03-29
2
636 Views
Last Modified: 2007-03-29
Hello ,
I am having problems with today.getTime()

my code is simply:
java.util.Date today = new java.util.Date();
new Timestamp (today.getTime()) )

but the timestamp is 1hr behind. My system time is correct

Is this releated to the day light savings stuff?

i would think today.getTime() would get my system time

Thanks for any help
0
Comment
Question by:paries
2 Comments
 
LVL 8

Expert Comment

by:LocoTechCJ
ID: 18819063
This could be a daylight savings issue.  If you are on a Microsoft OS, go to the site and run windows updates to make sure their fixes are installed.
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 18819072
Yes you might need the day light saving update:

http://java.sun.com/developer/technicalArticles/Intl/USDST/

The latest version of the JDK has taken care of this.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 43
PDFBox - convert image to PDF, PDF resolution 3 118
java  and programming certification ? 4 86
eclipse shortcuts 9 45
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now