System time off an hour?

Discussion in 'Java' started by Root, Aug 19, 2004.

  1. Root

    Root Guest

    Why would

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

    System.out.println(stop_time);


    return an hour slow? Checked bios and windows time.
    Root, Aug 19, 2004
    #1
    1. Advertising

  2. Root

    Root Guest

    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" <> wrote in message
    news:u78Vc.6098$...
    >
    > Why would
    >
    > Timestamp stop_time = new Timestamp(System.currentTimeMillis());
    >
    > System.out.println(stop_time);
    >
    >
    > return an hour slow? Checked bios and windows time.
    >
    Root, Aug 19, 2004
    #2
    1. Advertising

  3. Root

    Paul Lutus Guest

    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
    Paul Lutus, Aug 19, 2004
    #3
  4. Root

    P.Hill Guest

    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/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
    P.Hill, Aug 20, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Summu82
    Replies:
    5
    Views:
    849
    Richard Heathfield
    Jun 7, 2006
  2. Replies:
    2
    Views:
    866
    Hal Rosser
    Jun 1, 2007
  3. ssylee
    Replies:
    4
    Views:
    501
    Thad Smith
    Jan 1, 2008
  4. David Hearn
    Replies:
    1
    Views:
    405
    David Hearn
    Sep 10, 2003
  5. Chris Gunnels
    Replies:
    4
    Views:
    154
    Robert Klemme
    Sep 16, 2010
Loading...

Share This Page