Ignore:
Timestamp:
Oct 24, 2005, 1:45:59 PM (20 years ago)
Author:
sullivan
Message:

Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.

  • kjs/date_object.cpp: (KJS::makeTime): Fix the case where a time change crosses the daylight savings start/end dates.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r10801 r10932  
    885885    }
    886886
     887    // Determine whether DST is in effect. mktime() can't do this for us because
     888    // it doesn't know about ms and yearOffset.
     889    // NOTE: Casting values of large magnitude to time_t (long) will
     890    // produce incorrect results, but there's no other option when calling localtime_r().
     891    if (!utc) {
     892        time_t tval = mktime(t) + (time_t)((ms + yearOffset) / 1000); 
     893        struct tm t3; 
     894        localtime_r(&tval, &t3); 
     895        t->tm_isdst = t3.tm_isdst; 
     896    }
     897
    887898    return (mktime(t) + utcOffset) * msPerSecond + ms + yearOffset;
    888899}
Note: See TracChangeset for help on using the changeset viewer.