Updates:
Status: WorkingAsIntended
Comment #1 on issue 3397 by [email protected]: Date.setUTCMonth()
produces wrong output
http://code.google.com/p/v8/issues/detail?id=3397
Firefox behaves similarly. Consider this:
var date = new Date(2014, 1, 1, 0, 0, 0, 0);
// What you set here is actually 1st Feb 2014, since for some reason,
months are numbered zero-based.
date.getMonth()
1 // This means February!
date.getDate()
1 // Feb the first.
date1.getTimezoneOffset()
-60 // CET is 60 minutes ahead of UTC, and because of this...
date.getUTCDate()
31 // UTC time is still on the 31st of ...
date.getUTCDate()
0 // January
date1.getUTCHours()
23 // Late evening.
date.setUTCMonth(3) // Sets the month to... you guessed it ... April!
Note how April only has 30 days. So the date of 31 overflows and carries
over to the month.
date.getUTCDate()
1 // That's 1st of ...
date.getUTCMonth()
4 // May
date1.getUTCHours()
23 // Yep, still late evening.
That means that in central europe, we are at midnight, which counts towards
the next day.
date.getDate()
2 // 2nd of ...
date.getMonth()
4 // Still means May
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.