Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

today.getTime() is 1 hour behind

Posted on 2007-03-29
2
Medium Priority
?
670 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

704 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