OLD | NEW |
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 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
5 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 5 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) | 6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) |
7 * | 7 * |
8 * The Original Code is Mozilla Communicator client code, released | 8 * The Original Code is Mozilla Communicator client code, released |
9 * March 31, 1998. | 9 * March 31, 1998. |
10 * | 10 * |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute); | 793 offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute); |
794 } | 794 } |
795 return ms - (offset * msPerMinute); | 795 return ms - (offset * msPerMinute); |
796 } | 796 } |
797 | 797 |
798 // See http://tools.ietf.org/html/rfc2822#section-3.3 for more information. | 798 // See http://tools.ietf.org/html/rfc2822#section-3.3 for more information. |
799 String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsigned month, u
nsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset) | 799 String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsigned month, u
nsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset) |
800 { | 800 { |
801 StringBuilder stringBuilder; | 801 StringBuilder stringBuilder; |
802 stringBuilder.append(weekdayName[dayOfWeek]); | 802 stringBuilder.append(weekdayName[dayOfWeek]); |
803 stringBuilder.append(", "); | 803 stringBuilder.appendLiteral(", "); |
804 stringBuilder.appendNumber(day); | 804 stringBuilder.appendNumber(day); |
805 stringBuilder.append(' '); | 805 stringBuilder.append(' '); |
806 stringBuilder.append(monthName[month]); | 806 stringBuilder.append(monthName[month]); |
807 stringBuilder.append(' '); | 807 stringBuilder.append(' '); |
808 stringBuilder.appendNumber(year); | 808 stringBuilder.appendNumber(year); |
809 stringBuilder.append(' '); | 809 stringBuilder.append(' '); |
810 | 810 |
811 appendTwoDigitNumber(stringBuilder, hours); | 811 appendTwoDigitNumber(stringBuilder, hours); |
812 stringBuilder.append(':'); | 812 stringBuilder.append(':'); |
813 appendTwoDigitNumber(stringBuilder, minutes); | 813 appendTwoDigitNumber(stringBuilder, minutes); |
(...skipping 10 matching lines...) Expand all Loading... |
824 } | 824 } |
825 | 825 |
826 double convertToLocalTime(double ms) | 826 double convertToLocalTime(double ms) |
827 { | 827 { |
828 double utcOffset = calculateUTCOffset(); | 828 double utcOffset = calculateUTCOffset(); |
829 double dstOffset = calculateDSTOffset(ms, utcOffset); | 829 double dstOffset = calculateDSTOffset(ms, utcOffset); |
830 return (ms + utcOffset + dstOffset); | 830 return (ms + utcOffset + dstOffset); |
831 } | 831 } |
832 | 832 |
833 } // namespace WTF | 833 } // namespace WTF |
OLD | NEW |