Loading ...
Sorry, an error occurred while loading the content.

problem with ConvertTime (Win 32 2.06.01RB04) (fwd)

Expand Messages
  • Bob Warren
    It appears that the ConvertTime feature (convert from UTC to local time) has a bug in that US daylight savings time is not handled properly. Looking at the
    Message 1 of 1 , Sep 25, 2001
    • 0 Attachment
      It appears that the ConvertTime feature (convert from UTC to local time)
      has a bug in that US daylight savings time is not handled properly.

      Looking at the source code (actually for Win 32 version 2.06.01RB05) shows
      that the RecDate.tm_isdst value is set to 0 always, whether or not DST is
      in effect:

      from "webalizer.c"
      . . .
      if (ConvertTime)
      {
      struct tm RecDate;
      time_t result;
      RecDate.tm_sec=rec_sec; /* seconds after the minute - [0,59] */
      . . .
      RecDate.tm_isdst=0; /* daylight savings time flag */

      result = mktime( &RecDate);

      rec_sec=RecDate.tm_sec; /* seconds after the minute - [0,59] */
      . . .
      rec_year=RecDate.tm_year+1900; /* years since 1900 */
      }

      As a result, logs produced in April through October (on the East coast of
      the US) are off by one hour.

      I have experience with building programs with C on Win 32, but the Unix
      mktime() function will determine if DST is in effect if the tm_isdst
      structure member is set to '-1'. Is this true with the Win32 library?

      If so, could this fix be put in a future release?

      Thank you.
      Bob Warren

      rbw@...
    Your message has been successfully submitted and would be delivered to recipients shortly.