diff options
author | kh <qtc-committer@nokia.com> | 2009-07-29 16:32:57 (GMT) |
---|---|---|
committer | kh <qtc-committer@nokia.com> | 2009-07-29 16:32:57 (GMT) |
commit | 91005e4878c76630390fd17afec2f283fcd5121d (patch) | |
tree | c9a997a7c542da025ff00549ea80bd517557c577 /src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp | |
parent | f21a36efaab400e086a8c1e87f91da595e4a4443 (diff) | |
parent | b2b626a936d778b89f8fbf33ac914d99876ec4b3 (diff) | |
download | Qt-91005e4878c76630390fd17afec2f283fcd5121d.zip Qt-91005e4878c76630390fd17afec2f283fcd5121d.tar.gz Qt-91005e4878c76630390fd17afec2f283fcd5121d.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp index 47c9d44..0b76649 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp @@ -2,6 +2,7 @@ * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2007-2009 Torch Mobile, Inc. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. @@ -375,14 +376,19 @@ static int32_t calculateUTCOffset() localt.tm_wday = 0; localt.tm_yday = 0; localt.tm_isdst = 0; -#if PLATFORM(WIN_OS) || PLATFORM(SOLARIS) || COMPILER(RVCT) +#if HAVE(TM_GMTOFF) + localt.tm_gmtoff = 0; +#endif +#if HAVE(TM_ZONE) + localt.tm_zone = 0; +#endif + +#if HAVE(TIMEGM) + time_t utcOffset = timegm(&localt) - mktime(&localt); +#else // Using a canned date of 01/01/2009 on platforms with weaker date-handling foo. localt.tm_year = 109; time_t utcOffset = 1230768000 - mktime(&localt); -#else - localt.tm_zone = 0; - localt.tm_gmtoff = 0; - time_t utcOffset = timegm(&localt) - mktime(&localt); #endif return static_cast<int32_t>(utcOffset * 1000); @@ -512,7 +518,7 @@ void msToGregorianDateTime(double ms, bool outputIsUTC, GregorianDateTime& tm) tm.year = year - 1900; tm.isDST = dstOff != 0.0; - tm.utcOffset = static_cast<long>((dstOff + utcOff) / msPerSecond); + tm.utcOffset = outputIsUTC ? 0 : static_cast<long>((dstOff + utcOff) / msPerSecond); tm.timeZone = NULL; } @@ -835,7 +841,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString) return NaN; int sgn = (o < 0) ? -1 : 1; - o = abs(o); + o = labs(o); if (*dateString != ':') { offset = ((o / 100) * 60 + (o % 100)) * sgn; } else { // GMT+05:00 |