[webkit-changes] cvs commit: JavaScriptCore/kjs date_object.cpp

John sullivan at opensource.apple.com
Mon Oct 24 13:46:02 PDT 2005


sullivan    05/10/24 13:46:00

  Modified:    .        ChangeLog
               kjs      date_object.cpp
  Log:
          Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
          Date object does not always adjust daylight savings correctly
  
          * kjs/date_object.cpp:
          (KJS::makeTime):
          Fix the case where a time change crosses the daylight savings start/end dates.
  
  Revision  Changes    Path
  1.869     +11 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.868
  retrieving revision 1.869
  diff -u -r1.868 -r1.869
  --- ChangeLog	18 Oct 2005 03:15:26 -0000	1.868
  +++ ChangeLog	24 Oct 2005 20:45:54 -0000	1.869
  @@ -1,3 +1,14 @@
  +2005-10-24  John Sullivan  <sullivan at apple.com>
  +
  +        Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
  +        
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4142
  +        Date object does not always adjust daylight savings correctly
  +
  +        * kjs/date_object.cpp:
  +        (KJS::makeTime):
  +        Fix the case where a time change crosses the daylight savings start/end dates.
  +
   2005-10-17  Maciej Stachowiak  <mjs at apple.com>
   
           Reviewed by Geoff. Code changes by Darin.
  
  
  
  1.62      +11 -0     JavaScriptCore/kjs/date_object.cpp
  
  Index: date_object.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/date_object.cpp,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- date_object.cpp	9 Oct 2005 22:56:29 -0000	1.61
  +++ date_object.cpp	24 Oct 2005 20:45:59 -0000	1.62
  @@ -884,6 +884,17 @@
           t->tm_year = baseYear - 1900;
       }
   
  +    // Determine whether DST is in effect. mktime() can't do this for us because
  +    // it doesn't know about ms and yearOffset.
  +    // NOTE: Casting values of large magnitude to time_t (long) will 
  +    // produce incorrect results, but there's no other option when calling localtime_r().
  +    if (!utc) { 
  +        time_t tval = mktime(t) + (time_t)((ms + yearOffset) / 1000);  
  +        struct tm t3;  
  +        localtime_r(&tval, &t3);  
  +        t->tm_isdst = t3.tm_isdst;  
  +    }
  +
       return (mktime(t) + utcOffset) * msPerSecond + ms + yearOffset;
   }
   
  
  
  



More information about the webkit-changes mailing list