Inconsistent time zone

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Swansea University Psychology

    #1

    Inconsistent time zone

    Hi all,

    I have a utility that uses the C library function strftime() to return the
    time zone name, but it returns "GMT Standard Time" on one computer, and
    "BST" (which it should be at the moment) on the other computer.

    Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
    GMT +0 (London). And in the Date & Time control panel applet, both show "GMT
    Standard Time" as the Current time zone. Both have the correct date and time
    values.

    Can anyone suggest what's going wrong here?

    Regards,
    Neil
    --------------------------------------------
    Neil Carter Psychology Department
    IT Technician University of Wales Swansea
    Wales, United Kingdom




  • Bob I

    #2
    Re: Inconsistent time zone

    Daylight Saving Time box ticked?

    Swansea University Psychology wrote:
    [color=blue]
    > Hi all,
    >
    > I have a utility that uses the C library function strftime() to return the
    > time zone name, but it returns "GMT Standard Time" on one computer, and
    > "BST" (which it should be at the moment) on the other computer.
    >
    > Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
    > GMT +0 (London). And in the Date & Time control panel applet, both show "GMT
    > Standard Time" as the Current time zone. Both have the correct date and time
    > values.
    >
    > Can anyone suggest what's going wrong here?
    >
    > Regards,
    > Neil
    > --------------------------------------------
    > Neil Carter Psychology Department
    > IT Technician University of Wales Swansea
    > Wales, United Kingdom
    >
    > http://psy.swansea.ac.uk/staff/Carter/
    >
    >
    >[/color]

    Comment

    • Neil Carter

      #3
      Re: Inconsistent time zone

      > Swansea University Psychology wrote:[color=blue][color=green]
      >> I have a utility that uses the C library function strftime() to return
      >> the time zone name, but it returns "GMT Standard Time" on one computer,
      >> and "BST" (which it should be at the moment) on the other computer.[/color][/color]


      "Bob I" <birelan@yahoo. com> wrote in message
      news:41793599.2 060603@yahoo.co m...
      [color=blue]
      > Daylight Saving Time box ticked?[/color]

      Yup! Any other ideas?!

      Neil
      --------------------------------------------
      Neil Carter Psychology Department
      IT Technician University of Wales Swansea
      Wales, United Kingdom




      Comment

      • Neil Carter

        #4
        Re: Inconsistent time zone

        "Neil Carter" <pstech@swansea .ac.uk> wrote in message
        news:clbg6v$p6t $1@news.swman.n et.uk...[color=blue][color=green]
        >> Swansea University Psychology wrote:[color=darkred]
        >>> I have a utility that uses the C library function strftime() to return
        >>> the time zone name, but it returns "GMT Standard Time" on one computer,
        >>> and "BST" (which it should be at the moment) on the other computer.[/color][/color]
        > "Bob I" <birelan@yahoo. com> wrote in message
        > news:41793599.2 060603@yahoo.co m...
        >[color=green]
        >> Daylight Saving Time box ticked?[/color]
        >
        > Yup! Any other ideas?![/color]

        I managed to resolve this by unchecking the Automatically adjust option
        checkbox in Date and Time properties (on the machine returning GMT Standard
        Time), then clicking OK to close the dialog box, then going back into the
        dialog box and rechecking the checkbox and clicking OK again. Strftime("%Z")
        on that machine now returns GMT Daylight Time.

        The strange thing is that strftime() on the other machine (this machine, in
        fact) returns BST.

        There are other puzzling things... This machine returns BST even though it
        (incorrectly) shows GMT Standard Time in the Date and Time dialog box.

        Also, when I turned off the auto-adjust option on the other machine, the
        clock did not change its time, but when I tried it on this machine, it went
        back one hour. Furthermore, since I tried the same uncheck-check procedure
        on this machine, the dialog box now shows GMT Daylight Time, yet strftime()
        still returns BST!

        Weird.
        Neil
        --------------------------------------------
        Neil Carter Psychology Department
        IT Technician University of Wales Swansea
        Wales, United Kingdom




        Comment

        • Old Wolf

          #5
          Re: Inconsistent time zone

          "Neil Carter" <pstech@swansea .ac.uk> wrote:[color=blue]
          > "Neil Carter" <pstech@swansea .ac.uk> wrote:[color=green][color=darkred]
          > >> Swansea University Psychology wrote:
          > >>> I have a utility that uses the C library function
          > >>> strftime() to return the time zone name, but it
          > >>> returns "GMT Standard Time" on one computer,[/color][/color][/color]

          Greenwich Mean Time Standard Time? What an odd thing to return
          [color=blue][color=green][color=darkred]
          > >>> and "BST" (which it should be at the moment) on the other computer.[/color][/color][/color]

          At least one of them says something useful..
          [color=blue]
          > I managed to resolve this by unchecking the Automatically adjust option
          > checkbox in Date and Time properties (on the machine returning GMT Standard
          > Time), then clicking OK to close the dialog box, then going back into the
          > dialog box and rechecking the checkbox and clicking OK again. Strftime("%Z")
          > on that machine now returns GMT Daylight Time.[/color]

          There is no such thing as Greenwich Mean Time Daylight Time.
          To quote from www.greenwichmeantime.com,

          It is the same all year round and is not effected(sic)
          by Summer Time or Daylight saving Time.

          GMT is the mean (averaging out of minor variations over a year)
          time that the sun crosses the Greenwich meridian. To suggest that
          it changes for summer would be to suggest that the earth stops
          rotating for an hour when the time kicks in, or something
          equally absurd.
          [color=blue]
          > Also, when I turned off the auto-adjust option on the other machine, the
          > clock did not change its time, but when I tried it on this machine, it went
          > back one hour. Furthermore, since I tried the same uncheck-check procedure
          > on this machine, the dialog box now shows GMT Daylight Time, yet strftime()
          > still returns BST![/color]

          You are not the first person to be exasperated by the
          behaviour of the Windows API. Probably a better place
          to ask followup questions would be to a Windows
          programming newsgroup, or a Windows XP group.

          Comment

          • Dave Thompson

            #6
            Re: Inconsistent time zone

            On Fri, 22 Oct 2004 10:55:40 +0100, "Swansea University Psychology"
            <pstech@swansea .ac.uk> wrote:
            [color=blue]
            > I have a utility that uses the C library function strftime() to return the
            > time zone name, but it returns "GMT Standard Time" on one computer, and
            > "BST" (which it should be at the moment) on the other computer.
            >[/color]
            Per followup, un&reticking "Adjust for DST" changed to "GMT Daylight".
            [color=blue]
            > Both PCs are Windows XP Pro Service Pack 2. Both have their time zone set to
            > GMT +0 (London). <snip>[/color]

            What runtime are you using? E.g. is your program compiled with MSVC*
            (uses M$ library -- static or dynamic?); mingw (_mostly_ M$ library);
            cygwin (its own pseudo-Unix library); something else (?).

            If the M$ library, does (only) the second system have an environment
            variable TZ set, either globally (in Control Panel / System) or in the
            process where your app is run (perhaps by a .BAT file)? At least in my
            limited testing, that overrides the OS setting.

            - David.Thompson1 at worldnet.att.ne t

            Comment

            Working...