Discrepancy in current hour

Discussion in 'Java' started by Rhino, Mar 19, 2010.

  1. Rhino

    Rhino Guest

    I'm just retesting some date/time methods I wrote a while back and
    noticed something odd. It's 8 PM Eastern time as I write this and the
    date routines I have just retested tell me that it's actually 9 PM. Why
    would that be?

    I'm guessing it has something to do with Java date routines not correctly
    handling the earlier changeover to daylight savings time that started a
    few years back. If that's right, how should I be calculating the hour or
    the time?

    Or have I got something wrong in my computer somewhere? I'm running XP
    and the system clock says it's 8 PM Eastern time and it is set to
    recognize Daylight Saving Time. But I may not have installed the update
    that handles the earlier changeover to Daylight Time. Perhaps that needs
    to be installed??

    Here are the methods I'm using to get the current hour:

    public int getCurrentHour12HourClock() {

    /* Get the current date, then the current hour (12 hour clock). */
    GregorianCalendar now = new GregorianCalendar();
    return now.get(Calendar.HOUR);
    }

    public int getCurrentHour24HourClock() {

    /* Get the current date, then the current hour (24 hour clock). */
    GregorianCalendar now = new GregorianCalendar();
    return now.get(Calendar.HOUR_OF_DAY);
    }

    Here is the method I'm using to get the current time:

    public String getCurrentTime() {

    /* Get the current time. */
    GregorianCalendar now = new GregorianCalendar();
    int intCurrentHour = now.get(Calendar.HOUR_OF_DAY);
    int intCurrentMinute = now.get(Calendar.MINUTE);
    int intCurrentSecond = now.get(Calendar.SECOND);

    StringUtils stringUtils = StringUtils.getInstance();
    String strCurrentHour = stringUtils.pad(intCurrentHour, '0', 'L',
    2);
    String strCurrentMinute = stringUtils.pad(intCurrentMinute, '0',
    'L', 2);
    String strCurrentSecond = stringUtils.pad(intCurrentSecond, '0',
    'L', 2);

    /* Construct the string representing the current time. */
    return strCurrentHour + ":" + strCurrentMinute + ":" +
    strCurrentSecond; //$NON-NLS-1$ //$NON-NLS-2$
    }

    All of these methods are displaying one hour later than it actually is.

    --
    Rhino

    --- news://freenews.netfront.net/ - complaints: ---
     
    Rhino, Mar 19, 2010
    #1
    1. Advertising

  2. On 03/18/2010 08:34 PM, Rhino wrote:
    > I'm just retesting some date/time methods I wrote a while back and
    > noticed something odd. It's 8 PM Eastern time as I write this and the
    > date routines I have just retested tell me that it's actually 9 PM. Why
    > would that be?


    You probably don't have the up-to-date timezone data files for Java.

    See <http://java.sun.com/javase/tzupdater_README.html>.

    Yet another reason to tell politicians to stop messing with time: it
    makes the already complicated time system much more complicated in the
    programming world. For approximately no change in energy consumption.

    Actually, I wonder what the total cost is to adapt for a change in DST
    rules in terms of computer systems.

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
     
    Joshua Cranmer, Mar 19, 2010
    #2
    1. Advertising

  3. Rhino

    Arne Vajhøj Guest

    On 18-03-2010 20:34, Rhino wrote:
    > I'm just retesting some date/time methods I wrote a while back and
    > noticed something odd. It's 8 PM Eastern time as I write this and the
    > date routines I have just retested tell me that it's actually 9 PM. Why
    > would that be?
    >
    > I'm guessing it has something to do with Java date routines not correctly
    > handling the earlier changeover to daylight savings time that started a
    > few years back. If that's right, how should I be calculating the hour or
    > the time?
    >
    > Or have I got something wrong in my computer somewhere? I'm running XP
    > and the system clock says it's 8 PM Eastern time and it is set to
    > recognize Daylight Saving Time. But I may not have installed the update
    > that handles the earlier changeover to Daylight Time. Perhaps that needs
    > to be installed??
    >
    > Here are the methods I'm using to get the current hour:
    >
    > public int getCurrentHour12HourClock() {
    >
    > /* Get the current date, then the current hour (12 hour clock). */
    > GregorianCalendar now = new GregorianCalendar();
    > return now.get(Calendar.HOUR);
    > }
    >
    > public int getCurrentHour24HourClock() {
    >
    > /* Get the current date, then the current hour (24 hour clock). */
    > GregorianCalendar now = new GregorianCalendar();
    > return now.get(Calendar.HOUR_OF_DAY);
    > }
    >
    > Here is the method I'm using to get the current time:
    >
    > public String getCurrentTime() {
    >
    > /* Get the current time. */
    > GregorianCalendar now = new GregorianCalendar();
    > int intCurrentHour = now.get(Calendar.HOUR_OF_DAY);
    > int intCurrentMinute = now.get(Calendar.MINUTE);
    > int intCurrentSecond = now.get(Calendar.SECOND);
    >
    > StringUtils stringUtils = StringUtils.getInstance();
    > String strCurrentHour = stringUtils.pad(intCurrentHour, '0', 'L',
    > 2);
    > String strCurrentMinute = stringUtils.pad(intCurrentMinute, '0',
    > 'L', 2);
    > String strCurrentSecond = stringUtils.pad(intCurrentSecond, '0',
    > 'L', 2);
    >
    > /* Construct the string representing the current time. */
    > return strCurrentHour + ":" + strCurrentMinute + ":" +
    > strCurrentSecond; //$NON-NLS-1$ //$NON-NLS-2$
    > }
    >
    > All of these methods are displaying one hour later than it actually is.


    What Java version ? Including the update !

    Arne
     
    Arne Vajhøj, Mar 19, 2010
    #3
  4. Rhino

    Eric Sosman Guest

    On 3/18/2010 8:34 PM, Rhino wrote:
    > [...] But I may not have installed the update
    > that handles the earlier changeover to Daylight Time. Perhaps that needs
    > to be installed??


    That'd be my first guess, my very first guess, and quite
    likely my second as well. Third -- well, no, I'm not sure
    I'd go quite *that* far; perhaps there's something more subtle
    going on. But until you can assure us your Java is of this
    millennium, I'm not going to speculate.

    --
    Eric Sosman
    lid
     
    Eric Sosman, Mar 19, 2010
    #4
  5. Rhino

    Rhino Guest

    Arne Vajhøj <> wrote in
    news:4ba2c897$0$283$:

    > On 18-03-2010 20:34, Rhino wrote:
    >> I'm just retesting some date/time methods I wrote a while back and
    >> noticed something odd. It's 8 PM Eastern time as I write this and the
    >> date routines I have just retested tell me that it's actually 9 PM.
    >> Why would that be?
    >>
    >> I'm guessing it has something to do with Java date routines not
    >> correctly handling the earlier changeover to daylight savings time
    >> that started a few years back. If that's right, how should I be
    >> calculating the hour or the time?
    >>
    >> Or have I got something wrong in my computer somewhere? I'm running
    >> XP and the system clock says it's 8 PM Eastern time and it is set to
    >> recognize Daylight Saving Time. But I may not have installed the
    >> update that handles the earlier changeover to Daylight Time. Perhaps
    >> that needs to be installed??
    >>
    >> Here are the methods I'm using to get the current hour:
    >>
    >> public int getCurrentHour12HourClock() {
    >>
    >> /* Get the current date, then the current hour (12 hour clock).
    >> */
    >> GregorianCalendar now = new GregorianCalendar();
    >> return now.get(Calendar.HOUR);
    >> }
    >>
    >> public int getCurrentHour24HourClock() {
    >>
    >> /* Get the current date, then the current hour (24 hour clock).
    >> */
    >> GregorianCalendar now = new GregorianCalendar();
    >> return now.get(Calendar.HOUR_OF_DAY);
    >> }
    >>
    >> Here is the method I'm using to get the current time:
    >>
    >> public String getCurrentTime() {
    >>
    >> /* Get the current time. */
    >> GregorianCalendar now = new GregorianCalendar();
    >> int intCurrentHour = now.get(Calendar.HOUR_OF_DAY);
    >> int intCurrentMinute = now.get(Calendar.MINUTE);
    >> int intCurrentSecond = now.get(Calendar.SECOND);
    >>
    >> StringUtils stringUtils = StringUtils.getInstance();
    >> String strCurrentHour = stringUtils.pad(intCurrentHour, '0',
    >> 'L',
    >> 2);
    >> String strCurrentMinute = stringUtils.pad(intCurrentMinute,
    >> '0',
    >> 'L', 2);
    >> String strCurrentSecond = stringUtils.pad(intCurrentSecond,
    >> '0',
    >> 'L', 2);
    >>
    >> /* Construct the string representing the current time. */
    >> return strCurrentHour + ":" + strCurrentMinute + ":" +
    >> strCurrentSecond; //$NON-NLS-1$ //$NON-NLS-2$
    >> }
    >>
    >> All of these methods are displaying one hour later than it actually
    >> is.

    >
    > What Java version ? Including the update !
    >


    I'm running Java 1.6.18, which is pretty recent if I'm not mistaken ;-)

    --
    Rhino

    --- news://freenews.netfront.net/ - complaints: ---
     
    Rhino, Mar 19, 2010
    #5
  6. Rhino

    Rhino Guest

    Joshua Cranmer <> wrote in news:hnuh8d$aro$1@news-
    int2.gatech.edu:

    > On 03/18/2010 08:34 PM, Rhino wrote:
    >> I'm just retesting some date/time methods I wrote a while back and
    >> noticed something odd. It's 8 PM Eastern time as I write this and the
    >> date routines I have just retested tell me that it's actually 9 PM. Why
    >> would that be?

    >
    > You probably don't have the up-to-date timezone data files for Java.
    >
    > See <http://java.sun.com/javase/tzupdater_README.html>.
    >

    This is the first I've heard of them. Downloading now....

    > Yet another reason to tell politicians to stop messing with time: it
    > makes the already complicated time system much more complicated in the
    > programming world. For approximately no change in energy consumption.
    >
    > Actually, I wonder what the total cost is to adapt for a change in DST
    > rules in terms of computer systems.
    >

    Point well taken. I share your concerns and doubts about the value of
    making these DST changes. I have to wonder if the energy saved by some
    businesses is not more than outweighed by the grief this causes our
    industry.

    But then politics is pretty much always the practice of robbing Peter to
    pay Paul....


    --
    Rhino

    --- news://freenews.netfront.net/ - complaints: ---
     
    Rhino, Mar 19, 2010
    #6
  7. Rhino

    Roedy Green Guest

    On Fri, 19 Mar 2010 00:34:28 +0000 (UTC), Rhino
    <> wrote, quoted or indirectly
    quoted someone who said :

    >Or have I got something wrong in my computer somewhere? I'm running XP
    >and the system clock says it's 8 PM Eastern time and it is set to
    >recognize Daylight Saving Time. But I may not have installed the update
    >that handles the earlier changeover to Daylight Time. Perhaps that needs
    >to be installed??


    try SetClock to be sure your timezone and time are correct.
    see http://mindprod.com/webstart/setclock.html

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, “How would I develop if it were my money?” I’m amazed how many theoretical arguments evaporate when faced with this question.
    ~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
     
    Roedy Green, Mar 19, 2010
    #7
  8. Rhino

    Rhino Guest

    Roedy Green <> wrote in
    news::

    > On Fri, 19 Mar 2010 00:34:28 +0000 (UTC), Rhino
    > <> wrote, quoted or indirectly
    > quoted someone who said :
    >
    >>Or have I got something wrong in my computer somewhere? I'm running XP
    >>and the system clock says it's 8 PM Eastern time and it is set to
    >>recognize Daylight Saving Time. But I may not have installed the
    >>update that handles the earlier changeover to Daylight Time. Perhaps
    >>that needs to be installed??

    >
    > try SetClock to be sure your timezone and time are correct.
    > see http://mindprod.com/webstart/setclock.html
    >


    I'm very confused, Roedy.

    I clicked on your link and launched your program without any
    difficulties. However, I don't understand how it is behaving.

    Before I launched SetClock, the clock on my PC (I'm running XP with SP2)
    shows a time of 15:26 Eastern time. The time.gov website confirms this
    is the correct time for the Eastern time zone.

    When I clicked on SetClock, the GUI showed:
    Your Time Zone: Eastern Daylight Time (GMT-4:00)
    Your PC's Clock: Friday 2010/03/19 04:29:00 PM
    Correction: 59 minutes and 59 seconds
    Accurate clock: Friday: 201003/19 03:29:56 PM

    When I clicked on the SetClock button, the time on my computer changed
    to 2:31 and the SetClock GUI now shows 3:31 in both the "Your PC's
    Clock" and "Accurate Clock" fields and Correction now says "none".

    However, my Java date routines now show the correct hour, 3 P.M.

    To paraphrase from Battlestar Galactica, "what the frak??"

    How do I get the Java routines to get the right time WHILE STILL HAVING
    WINDOWS ITSELF DISPLAY THE CORRECT TIME?


    --
    Rhino
     
    Rhino, Mar 19, 2010
    #8
  9. Rhino

    Arne Vajhøj Guest

    On 18-03-2010 23:49, Rhino wrote:
    > Arne Vajhøj<> wrote in
    > news:4ba2c897$0$283$:
    >> On 18-03-2010 20:34, Rhino wrote:
    >>> I'm just retesting some date/time methods I wrote a while back and
    >>> noticed something odd. It's 8 PM Eastern time as I write this and the
    >>> date routines I have just retested tell me that it's actually 9 PM.
    >>> Why would that be?
    >>>
    >>> I'm guessing it has something to do with Java date routines not
    >>> correctly handling the earlier changeover to daylight savings time
    >>> that started a few years back. If that's right, how should I be
    >>> calculating the hour or the time?
    >>>
    >>> Or have I got something wrong in my computer somewhere? I'm running
    >>> XP and the system clock says it's 8 PM Eastern time and it is set to
    >>> recognize Daylight Saving Time. But I may not have installed the
    >>> update that handles the earlier changeover to Daylight Time. Perhaps
    >>> that needs to be installed??

    ....
    >>> All of these methods are displaying one hour later than it actually
    >>> is.

    >>
    >> What Java version ? Including the update !

    >
    > I'm running Java 1.6.18, which is pretty recent if I'm not mistaken ;-)


    It is latest, so it should have the correct timezone definitions.

    Something is confusing Java on your PC.

    Arne
     
    Arne Vajhøj, Mar 20, 2010
    #9
  10. Rhino

    Arne Vajhøj Guest

    On 19-03-2010 00:02, Rhino wrote:
    > Joshua Cranmer<> wrote in news:hnuh8d$aro$1@news-
    > int2.gatech.edu:
    >> On 03/18/2010 08:34 PM, Rhino wrote:
    >>> I'm just retesting some date/time methods I wrote a while back and
    >>> noticed something odd. It's 8 PM Eastern time as I write this and the
    >>> date routines I have just retested tell me that it's actually 9 PM. Why
    >>> would that be?

    >>
    >> You probably don't have the up-to-date timezone data files for Java.
    >>
    >> See<http://java.sun.com/javase/tzupdater_README.html>.
    >>

    > This is the first I've heard of them. Downloading now....


    It is only relevant for old Java versions.

    Arne
     
    Arne Vajhøj, Mar 20, 2010
    #10
  11. Rhino

    Lew Guest

    Rhino wrote:
    >>>> I'm just retesting some date/time methods I wrote a while back and
    >>>> noticed something odd. It's 8 PM Eastern time as I write this and the
    >>>> date routines I have just retested tell me that it's actually 9 PM.
    >>>> Why would that be?
    >>>>
    >>>> I'm guessing it has something to do with Java date routines not
    >>>> correctly handling the earlier changeover to daylight savings time
    >>>> that started a few years back. If that's right, how should I be
    >>>> calculating the hour or the time?
    >>>>
    >>>> Or have I got something wrong in my computer somewhere? I'm running
    >>>> XP and the system clock says it's 8 PM Eastern time and it is set to
    >>>> recognize Daylight Saving Time. But I may not have installed the
    >>>> update that handles the earlier changeover to Daylight Time. Perhaps
    >>>> that needs to be installed??
    >>>> ...
    >>>> I'm running Java 1.6.18, which is pretty recent if I'm not mistaken ;-)


    Arne Vajhøj wrote:
    > It is latest, so it should have the correct timezone definitions.
    >
    > Something is confusing Java on your PC.


    Or something is confusing Windows or the PC itself.

    What does the OS claim the time zone is, independently of Java?

    Do the OS time and BIOS time match?

    Would the OP provide an SSCCE and copy-paste actual output, and a comparison
    with what was expected?

    The problem has to be in a detail that hasn't reached Usenet yet.

    For example, what is this 'StringUtils'? If 'String' formatted
    representations are needed of a 'Calendar', what's wrong with using 'DateFormat'?

    I really, really don't think that "it has something to do with Java date
    routines not correctly handling the earlier changeover to daylight savings
    time" or anything else to do with the standard API, nor do I think it's a
    problem with out-of-date tzdata.

    I'm deeply suspicious of code that uses a 'Calendar', then extracts fields
    from it, then pads the fields back into 'String's. That's an awful lot of
    custom conversion, with lots of room for things to be done wrong, for one to
    go around calumnizing the java.* packages.

    Look to thine own house first.

    --
    Lew
     
    Lew, Mar 20, 2010
    #11
  12. Rhino

    Roedy Green Guest

    On Fri, 19 Mar 2010 19:38:27 +0000 (UTC), Rhino
    <> wrote, quoted or indirectly
    quoted someone who said :

    >How do I get the Java routines to get the right time WHILE STILL HAVING
    >WINDOWS ITSELF DISPLAY THE CORRECT TIME?


    Click the clock time in the bottom right.
    click change date and time settings.
    Click change time zone.
    Make sure you have the correct timezone.
    Click "adjust clock for daylight saving".

    Rerun Setclock.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, “How would I develop if it were my money?” I’m amazed how many theoretical arguments evaporate when faced with this question.
    ~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
     
    Roedy Green, Mar 20, 2010
    #12
  13. Lew wrote:
    > Rhino wrote:
    >>>>> I'm just retesting some date/time methods I wrote a while back and
    >>>>> noticed something odd. It's 8 PM Eastern time as I write this and the
    >>>>> date routines I have just retested tell me that it's actually 9 PM.
    >>>>> Why would that be?
    >>>>>
    >>>>> I'm guessing it has something to do with Java date routines not
    >>>>> correctly handling the earlier changeover to daylight savings time
    >>>>> that started a few years back. If that's right, how should I be
    >>>>> calculating the hour or the time?
    >>>>>
    >>>>> Or have I got something wrong in my computer somewhere? I'm running
    >>>>> XP and the system clock says it's 8 PM Eastern time and it is set to
    >>>>> recognize Daylight Saving Time. But I may not have installed the
    >>>>> update that handles the earlier changeover to Daylight Time. Perhaps
    >>>>> that needs to be installed??
    >>>>> ...
    >>>>> I'm running Java 1.6.18, which is pretty recent if I'm not mistaken
    >>>>> ;-)

    >
    > Arne Vajhøj wrote:
    >> It is latest, so it should have the correct timezone definitions.
    >>
    >> Something is confusing Java on your PC.

    >
    > Or something is confusing Windows or the PC itself.
    >
    > What does the OS claim the time zone is, independently of Java?
    >
    > Do the OS time and BIOS time match?
    >
    > Would the OP provide an SSCCE and copy-paste actual output, and a
    > comparison with what was expected?
    >
    > The problem has to be in a detail that hasn't reached Usenet yet.
    >
    > For example, what is this 'StringUtils'? If 'String' formatted
    > representations are needed of a 'Calendar', what's wrong with using
    > 'DateFormat'?

    [ SNIP ]

    Rhino mentioned a StringUtils class of his own - it was the subject of
    the "Design question" thread dating from 15 March. Although there are
    dozens of StringUtils classes put out by various projects, the most
    notable probably being Apache Commons Lang, I'm guessing the one here is
    likely Rhino's.

    The first thing I'm usually suspicious of when a test reports a test
    failure is the test itself. As part of one maintenance project back in
    2008 I spent the best part of a month fixing defects in a JUnit test
    suite; nearly a hundred JUnit tests were themselves broken. They hadn't
    necessarily always been - most of them were OK when written - but they
    failed to track code changes. But some had clearly always been wrong.

    I think it's a bit crazy to unit test your unit tests, under normal
    conditions; nevertheless it's worth keeping in mind that if you can't
    keep your tested code error-free then neither can you keep your testing
    code error-free, and interpret the output of tests accordingly.

    In that project I mentioned, the tests that had the highest problem
    percentage involved date/time code. No surprise there. Both the
    date/time code under test, and the date/time code *in* the tests, were
    riddled with defects.

    Under the circumstances, in this hypothetical SSCCE, I'd be checking the
    tests first.

    AHS
     
    Arved Sandstrom, Mar 20, 2010
    #13
  14. Rhino

    Lew Guest

    Lew wrote:
    >> For example, what is this 'StringUtils'? If 'String' formatted
    >> representations are needed of a 'Calendar', what's wrong with using
    >> 'DateFormat'?


    Arved Sandstrom wrote:
    > Rhino mentioned a StringUtils class of his own - it was the subject of
    > the "Design question" thread dating from 15 March. Although there are
    > dozens of StringUtils classes put out by various projects, the most
    > notable probably being Apache Commons Lang, I'm guessing the one here is
    > likely Rhino's.


    Same here, but that doesn't answer my question. I mean "what is?" as in "show
    us the code", as it is at the time of the bug under discussion. That has not
    been shown.

    > The first thing I'm usually suspicious of when a test reports a test
    > failure is the test itself. As part of one maintenance project back in
    > 2008 I spent the best part of a month fixing defects in a JUnit test
    > suite; nearly a hundred JUnit tests were themselves broken. They hadn't
    > necessarily always been - most of them were OK when written - but they
    > failed to track code changes. But some had clearly always been wrong.


    I've seen this, too, coincidentally in one case where it was calendar
    functions under test and the bug in the unit test permitted wrong code to go
    into production.

    > I think it's a bit crazy to unit test your unit tests, under normal
    > conditions; nevertheless it's worth keeping in mind that if you can't
    > keep your tested code error-free then neither can you keep your testing
    > code error-free, and interpret the output of tests accordingly.
    >
    > In that project I mentioned, the tests that had the highest problem
    > percentage involved date/time code. No surprise there. Both the
    > date/time code under test, and the date/time code *in* the tests, were
    > riddled with defects.
    >
    > Under the circumstances, in this hypothetical SSCCE, I'd be checking the
    > tests first.


    The problem is that the SSCCE is hypothetical.

    Rhino, we need an SSCCE to proceed further.

    --
    Lew
     
    Lew, Mar 20, 2010
    #14
  15. Rhino

    Lew Guest

    Rhino said :
    >> How do I get the Java routines to get the right time WHILE STILL HAVING
    >> WINDOWS ITSELF DISPLAY THE CORRECT TIME?


    Provide an SSCCE!

    --
    Lew
     
    Lew, Mar 20, 2010
    #15
  16. Rhino

    Rhino Guest

    Roedy Green <> wrote in
    news::

    > On Fri, 19 Mar 2010 19:38:27 +0000 (UTC), Rhino
    > <> wrote, quoted or indirectly
    > quoted someone who said :
    >
    >>How do I get the Java routines to get the right time WHILE STILL HAVING
    >>WINDOWS ITSELF DISPLAY THE CORRECT TIME?

    >
    > Click the clock time in the bottom right.
    > click change date and time settings.
    > Click change time zone.
    > Make sure you have the correct timezone.
    > Click "adjust clock for daylight saving".
    >


    I clicked on the Windows clock icon and found that the time is already set
    to 1:37 PM; the date is already correct. The timezone is already set to GMT
    -5:00 Eastern Time, Canada and US. The observe daylight saving time box is
    checked. In other words, Windows clock is already exactly right.

    > Rerun Setclock.


    When I launched SetClock, it said the timezone was "EDT : Eastern Daylight
    Time (GMT-04:00)" [NOT GMT-5:00] and claimed that my PC clock was set to
    2:37 [NOT 1:37]. I clicked on the GetTime button and the correction
    appeared as 59 minutes, 59 seconds. I clicked on the SetClock button and
    the SetClock GUI now says the PC Clock is 1:37 and the Accurate Clock is
    1:37. The Windows Clock now says 12:37, which is an hour early of the
    correct time.

    Am I not understanding your instructions or is there something wrong here?

    If there IS something wrong, where is the problem? In XP? Or could there be
    a bug in your SetClock program?


    --
    Rhino
     
    Rhino, Mar 20, 2010
    #16
  17. Rhino

    Lew Guest

    Rhino wrote:
    > I clicked on the Windows clock icon and found that the time is already set
    > to 1:37 PM; the date is already correct. The timezone is already set to GMT


    So are we to conclude, as you have not stated it, that the time you checked
    was actually 1:37 p.m. Eastern Daylight, and that you are in the Eastern time
    zone?

    > -5:00 Eastern Time, Canada and US. The observe daylight saving time box is


    That is not correct, if you are in the Eastern Time Zone and DST is in effect.
    If you are in the Eastern Time Zone and DST is in effect, you are at GMT-04:00.

    > checked. In other words, Windows clock is already exactly right.


    Your statements leave room for doubt about that.

    >> Rerun Setclock.

    >
    > When I launched SetClock, it said the timezone was "EDT : Eastern Daylight
    > Time (GMT-04:00)" [NOT GMT-5:00] and claimed that my PC clock was set to


    That is correct. The Eastern Time Zone is currently in DST and is GMT-04:00.

    Why do you not think that is correct?

    > 2:37 [NOT 1:37]. I clicked on the GetTime button and the correction
    > appeared as 59 minutes, 59 seconds. I clicked on the SetClock button and
    > the SetClock GUI now says the PC Clock is 1:37 and the Accurate Clock is
    > 1:37. The Windows Clock now says 12:37, which is an hour early of the
    > correct time.


    Your Windows clock must be set wrong.

    > Am I not understanding your instructions or is there something wrong here?
    >
    > If there IS something wrong, where is the problem? In XP? Or could there be
    > a bug in your SetClock program?


    The problem is in your environment, not the software you keep trying to blame.

    --
    Lew
     
    Lew, Mar 20, 2010
    #17
  18. Rhino

    Rhino Guest

    Lew <> wrote in news:ho2ljt$e44$:

    > Rhino said :
    >>> How do I get the Java routines to get the right time WHILE STILL HAVING
    >>> WINDOWS ITSELF DISPLAY THE CORRECT TIME?

    >
    > Provide an SSCCE!
    >


    You're kidding, right? If not, how do I provide an SSCCE of what the clock
    on my PC is doing?

    I could do some screen shots, assuming I can think of some place to put
    them where you can see it but short of that, I don't know how to honour
    your request.....

    --
    Rhino
     
    Rhino, Mar 20, 2010
    #18
  19. Rhino

    Lew Guest

    Rhino said :
    >>>> How do I get the Java routines to get the right time WHILE STILL HAVING
    >>>> WINDOWS ITSELF DISPLAY THE CORRECT TIME?


    Lew wrote:
    >> Provide an SSCCE!


    Rhino wrote:
    > You're kidding, right? If not, how do I provide an SSCCE of what the clock
    > on my PC is doing?


    No, I mean of the Java code, duh.

    > I could do some screen shots, assuming I can think of some place to put
    > them where you can see it but short of that, I don't know how to honour
    > your request.....


    By honoring the actual request.

    --
    Lew
     
    Lew, Mar 20, 2010
    #19
  20. Rhino

    Rhino Guest

    Lew <> wrote in news:ho33sk$h1p$:

    > Rhino wrote:
    >> I clicked on the Windows clock icon and found that the time is
    >> already set to 1:37 PM; the date is already correct. The timezone is
    >> already set to GMT

    >
    > So are we to conclude, as you have not stated it, that the time you
    > checked was actually 1:37 p.m. Eastern Daylight, and that you are in
    > the Eastern time zone?
    >
    >> -5:00 Eastern Time, Canada and US. The observe daylight saving time
    >> box is

    >
    > That is not correct, if you are in the Eastern Time Zone and DST is in
    > effect.
    > If you are in the Eastern Time Zone and DST is in effect, you are at
    > GMT-04:00.
    >

    I am indeed in the Eastern Time Zone and DST went into effect last
    weekend. However, Windows XP isn't going to let me set the timezone to
    Eastern Time GMT-4:00. Windows gives me a drop down menu showing me
    umpteen timezone and Eastern GMT-4:00 isn't one of them. It also provides
    a checkbox that says "automatically adjust clock for DST", which I have
    checked.

    >> checked. In other words, Windows clock is already exactly right.

    >
    > Your statements leave room for doubt about that.
    >
    >>> Rerun Setclock.

    >>
    >> When I launched SetClock, it said the timezone was "EDT : Eastern
    >> Daylight Time (GMT-04:00)" [NOT GMT-5:00] and claimed that my PC
    >> clock was set to

    >
    > That is correct. The Eastern Time Zone is currently in DST and is
    > GMT-04:00.
    >
    > Why do you not think that is correct?
    >

    I'm not saying it isn't correct. I'm saying that it is not consistent
    with what Windows is telling me. I'm trying to find out if the behaviour
    I'm seeing in SetClock is wrong or if Windows is behaving badly.

    >> 2:37 [NOT 1:37]. I clicked on the GetTime button and the correction
    >> appeared as 59 minutes, 59 seconds. I clicked on the SetClock button
    >> and the SetClock GUI now says the PC Clock is 1:37 and the Accurate
    >> Clock is 1:37. The Windows Clock now says 12:37, which is an hour
    >> early of the correct time.

    >
    > Your Windows clock must be set wrong.
    >
    >> Am I not understanding your instructions or is there something wrong
    >> here?
    >>
    >> If there IS something wrong, where is the problem? In XP? Or could
    >> there be a bug in your SetClock program?

    >
    > The problem is in your environment, not the software you keep trying
    > to blame.
    >


    Actually, I'm NOT trying to blame Roedy's SetClock, I'm trying to
    understand the behaviour I am getting. If the problem is in Windows,
    that's fine, I'm quite prepared to accept that. For the moment, I'm just
    trying to be sure that I'm following Roedy's instructions correctly. The
    first point of failure with this kind of thing is usually communications
    issues over understanding the instructions, at least in my case.

    --
    Rhino
     
    Rhino, Mar 20, 2010
    #20
    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. Anand P Paralkar

    Discrepancy in CLB Usage Report

    Anand P Paralkar, Jul 2, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,064
    Anand P Paralkar
    Jul 2, 2003
  2. Replies:
    2
    Views:
    919
    Hal Rosser
    Jun 1, 2007
  3. ssylee
    Replies:
    4
    Views:
    542
    Thad Smith
    Jan 1, 2008
  4. Ram  Prasad

    Most efficient way of getting current hour

    Ram Prasad, May 13, 2010, in forum: C Programming
    Replies:
    11
    Views:
    547
    Richard Bos
    May 15, 2010
  5. Chris Gunnels
    Replies:
    4
    Views:
    191
    Robert Klemme
    Sep 16, 2010
Loading...

Share This Page