Solved

today.getTime() is 1 hour behind

Posted on 2007-03-29
2
652 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
more than one jdk and one jre 1 50
java stored proc example 9 45
Android development question 2 54
ejb message driven bean mdb creation steps 2 23
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

827 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