Commit 388ad028 authored by whesse@chromium.org's avatar whesse@chromium.org

Modify date printing to fetch time zone name before converting to local time,...

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 77fb69b6
...@@ -668,7 +668,8 @@ function DateNow() { ...@@ -668,7 +668,8 @@ function DateNow() {
function DateToString() { function DateToString() {
var t = DATE_VALUE(this); var t = DATE_VALUE(this);
if (NUMBER_IS_NAN(t)) return kInvalidDate; 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 DateToDateString() { ...@@ -684,8 +685,8 @@ function DateToDateString() {
function DateToTimeString() { function DateToTimeString() {
var t = DATE_VALUE(this); var t = DATE_VALUE(this);
if (NUMBER_IS_NAN(t)) return kInvalidDate; if (NUMBER_IS_NAN(t)) return kInvalidDate;
var lt = LocalTimeNoCheck(t); var time_zone_string = LocalTimezoneString(t); // May update local offset.
return TimeString(lt) + LocalTimezoneString(lt); return TimeString(LocalTimeNoCheck(t)) + time_zone_string;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment