Changeset 17010 in webkit for trunk/JavaScriptCore/kjs/DateMath.h


Ignore:
Timestamp:
Oct 12, 2006, 10:58:09 AM (19 years ago)
Author:
kmccullo
Message:

Reviewed by Geoff.

Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly. Also there is some code cleanup.

  • kjs/DateMath.cpp: (KJS::timeToMS): (KJS::getUTCOffset): (KJS::getDSTOffsetSimple): (KJS::dateToMS): (KJS::msToTM): (KJS::tmToKJStm): (KJS::KJStmToTm):
  • kjs/DateMath.h:
  • kjs/date_object.cpp: (KJS::gmtoffset): (KJS::formatTime): (KJS::DateProtoFunc::callAsFunction): (KJS::DateObjectImp::construct): (KJS::DateObjectImp::callAsFunction): (KJS::DateObjectFuncImp::callAsFunction): (KJS::parseDate):
  • kjs/date_object.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/DateMath.h

    r16855 r17010  
    4646namespace KJS {
    4747
     48// Intentionally overridding the default tm of the system
     49// Not all OS' have the same members of their tm's
     50struct tm {
     51    int tm_sec;
     52    int tm_min;
     53    int tm_hour;
     54    int tm_wday;
     55    int tm_mday;
     56    int tm_yday;
     57    int tm_mon;
     58    int tm_year;
     59    int tm_isdst;
     60    long tm_gmtoff;
     61    char* tm_zone;
     62};
     63
    4864// Constants //
    4965
     
    6177// Exported Functions //
    6278void msToTM(double, bool outputIsUTC, struct tm& );
    63 double dateToMseconds(tm*, double, bool inputIsUTC);
     79double dateToMS(const tm&, double, bool inputIsUTC);
    6480double getUTCOffset();
     81
     82tm tmToKJStm(const struct ::tm&);
     83::tm KJStmToTm(const struct tm&);
    6584
    6685}   //namespace KJS
Note: See TracChangeset for help on using the changeset viewer.