Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > System time off an hour?

Reply
Thread Tools

System time off an hour?

 
 
Root
Guest
Posts: n/a
 
      08-19-2004

Why would

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

System.out.println(stop_time);


return an hour slow? Checked bios and windows time.


 
Reply With Quote
 
 
 
 
Root
Guest
Posts: n/a
 
      08-19-2004
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?

"Root" <(E-Mail Removed)> wrote in message
news:u78Vc.6098$(E-Mail Removed) m...
>
> Why would
>
> Timestamp stop_time = new Timestamp(System.currentTimeMillis());
>
> System.out.println(stop_time);
>
>
> return an hour slow? Checked bios and windows time.
>



 
Reply With Quote
 
 
 
 
Paul Lutus
Guest
Posts: n/a
 
      08-19-2004
Root wrote:

>
> 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.

--
Paul Lutus
http://www.arachnoid.com

 
Reply With Quote
 
P.Hill
Guest
Posts: n/a
 
      08-20-2004
Paul Lutus wrote:

> Root wrote:
>>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.


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/...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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert UTC to local time(system time) and vice vesra in VB.NET deepak ASP .Net 1 02-06-2008 02:34 PM
Need your help please. Covert time to army time, and trim off the date & am/pm jonny ASP .Net 1 10-10-2007 02:59 PM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
System.Security.SecurityException: Error de solicitud de permiso de tipo System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Luis Esteban Valencia ASP .Net 0 07-14-2005 01:43 PM
How to control user account can't login system twice at the same time in Web base system?? Lawrance ASP .Net 0 11-30-2003 09:56 AM



Advertisments