Ignore:
Timestamp:
Mar 14, 2008, 7:59:38 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Get rid of a localime() call on platforms that have better alternatives.

  • kjs/DateMath.h: Added getLocalTime();
  • kjs/DateMath.cpp: (KJS::getLocalTime): (KJS::getDSTOffsetSimple): Implementation moved from getDSTOffsetSimple().
  • kjs/date_object.cpp: (KJS::DateObjectImp::callAsFunction): Switched to getLocalTime().
File:
1 edited

Legend:

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

    r30625 r31057  
    518518JSValue *DateObjectImp::callAsFunction(ExecState * /*exec*/, JSObject * /*thisObj*/, const List &/*args*/)
    519519{
    520     time_t t = time(0);
    521     GregorianDateTime ts(*localtime(&t));
     520    time_t localTime = time(0);
     521    tm localTM;
     522    getLocalTime(&localTime, &localTM);
     523    GregorianDateTime ts(localTM);
    522524    return jsString(formatDate(ts) + " " + formatTime(ts, false));
    523525}
Note: See TracChangeset for help on using the changeset viewer.