Solved

today.getTime() is 1 hour behind

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse buid path vs tomcat lib path 10 37
mysql jsp example issue 32 70
collection output issue 9 59
jsp CRUD operations with and without prepared statement also hibernatge 1 27
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

756 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