Revision: 4342
Author: [email protected]
Date: Tue Apr  6 03:22:52 2010
Log: Modify date printing to fetch time zone name before converting to local time, so that the two agree. Fix a problem in DateToTimeString() time zone calculation.
Review URL: http://codereview.chromium.org/1539009
http://code.google.com/p/v8/source/detail?r=4342

Modified:
 /branches/bleeding_edge/src/date.js

=======================================
--- /branches/bleeding_edge/src/date.js Wed Mar 31 05:20:32 2010
+++ /branches/bleeding_edge/src/date.js Tue Apr  6 03:22:52 2010
@@ -668,7 +668,8 @@
 function DateToString() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return kInvalidDate;
-  return DatePrintString(LocalTimeNoCheck(t)) + LocalTimezoneString(t);
+ var time_zone_string = LocalTimezoneString(t); // May update local offset.
+  return DatePrintString(LocalTimeNoCheck(t)) + time_zone_string;
 }


@@ -684,8 +685,8 @@
 function DateToTimeString() {
   var t = DATE_VALUE(this);
   if (NUMBER_IS_NAN(t)) return kInvalidDate;
-  var lt = LocalTimeNoCheck(t);
-  return TimeString(lt) + LocalTimezoneString(lt);
+ var time_zone_string = LocalTimezoneString(t); // May update local offset.
+  return TimeString(LocalTimeNoCheck(t)) + time_zone_string;
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

To unsubscribe, reply using "remove me" as the subject.

Reply via email to