Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Side by Side Diff: third_party/WebKit/JavaScriptCore/runtime/DateMath.cpp

Issue 46097: WebKit merge 41660:41709 (WebKit side).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * 4 *
5 * The Original Code is Mozilla Communicator client code, released 5 * The Original Code is Mozilla Communicator client code, released
6 * March 31, 1998. 6 * March 31, 1998.
7 * 7 *
8 * The Initial Developer of the Original Code is 8 * The Initial Developer of the Original Code is
9 * Netscape Communications Corporation. 9 * Netscape Communications Corporation.
10 * Portions created by the Initial Developer are Copyright (C) 1998 10 * Portions created by the Initial Developer are Copyright (C) 1998
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 return buffer; 912 return buffer;
913 } 913 }
914 914
915 UString formatTime(const GregorianDateTime &t, bool utc) 915 UString formatTime(const GregorianDateTime &t, bool utc)
916 { 916 {
917 char buffer[100]; 917 char buffer[100];
918 if (utc) { 918 if (utc) {
919 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT", t.hour, t.minute, t.second); 919 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT", t.hour, t.minute, t.second);
920 } else { 920 } else {
921 int offset = abs(gmtoffset(t)); 921 int offset = abs(gmtoffset(t));
922 char tzname[70]; 922 char timeZoneName[70];
923 struct tm gtm = t; 923 struct tm gtm = t;
924 strftime(tzname, sizeof(tzname), "%Z", &gtm); 924 strftime(timeZoneName, sizeof(timeZoneName), "%Z", &gtm);
925 925
926 if (tzname[0]) { 926 if (timeZoneName[0]) {
927 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)" , 927 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d (%s)" ,
928 t.hour, t.minute, t.second, 928 t.hour, t.minute, t.second,
929 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, tzname); 929 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName);
930 } else { 930 } else {
931 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d", 931 snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT%c%02d%02d",
932 t.hour, t.minute, t.second, 932 t.hour, t.minute, t.second,
933 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60); 933 gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60);
934 } 934 }
935 } 935 }
936 return UString(buffer); 936 return UString(buffer);
937 } 937 }
938 938
939 } // namespace JSC 939 } // namespace JSC
940 940
OLDNEW
« no previous file with comments | « third_party/WebKit/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj ('k') | third_party/WebKit/WebCore/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698