System time off an hour?

R

Root

Why would

Timestamp stop_time = new Timestamp(System.currentTimeMillis());

System.out.println(stop_time);


return an hour slow? Checked bios and windows time.
 
R

Root

very odd....

I changed the windows time up an hour and it return the correct hour. (moved
2 hours)

changed it back and it was still slow by 1?

hit apply did the above again.

And now it returns the correct time.... Does this happen often?
 
P

Paul Lutus

Root said:
Why would

Timestamp stop_time = new Timestamp(System.currentTimeMillis());

System.out.println(stop_time);


return an hour slow? Checked bios and windows time.

It may be that this specific method doesn't honor daylight time.
 
P

P.Hill

Paul said:
It may be that this specific method doesn't honor daylight time.

Which method Timestamp.toString()?
That is possible since it is an override of Date.toString()
and says it "Formats a timestamp in JDBC timestamp escape format"
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Timestamp.html#toString()

Note that toString() is not guarenteed to do anything but provide
a useful string, but I see on my machine during DLS the result is the current
wall clock local time (with summer DLS).

I believe the OPS problem is he jerked with the machines TZ, but needs
to restart the VM to get this to take effect in the VM.

-Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top