Closed
Bug 1106530
Opened 10 years ago
Closed 10 years ago
Forefox 33.1.1 new Date("2014/01/01") return wrong date
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1079720
Iteration:
37.1
People
(Reporter: yaatmb, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Build ID: 20141113143407
Steps to reproduce:
open console (F12)
input:
new Date("2014/01/01")
Actual results:
Date {Tue Dec 31 2013 23:00:00 GMT+0300}
Expected results:
Date {Wed Jan 01 2014 00:00:00 GMT+0400}
Updated•10 years ago
|
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Updated•10 years ago
|
Component: JavaScript Engine → JavaScript: Standard Library
![]() |
||
Comment 1•10 years ago
|
||
Which timezone are you in? What does
new Date("2014/01/01").getTimezoneOffset()
show?
Severity: critical → normal
Flags: needinfo?(yaatmb)
new Date("2014/01/01").getTimezoneOffset()
shows:
-180
Flags: needinfo?(yaatmb)
![]() |
||
Comment 3•10 years ago
|
||
OK. So that's GMT+3, not surprising given the toString() output. Again, what timezone are you in and why do you expect GMT+4 instead of GMT+3?
Flags: needinfo?(yaatmb)
1. new Date("2014/01/01") must returns 01 January 2014
2. I'm from Russia (Moscow Timezone "RTZ 2"). Timezone in Moscow was changed [26 October 2014 02:00] from GMT+4 to GMT+3
3. I wrote about this bug in google chrome bugtracker, now google chrome in updated version work correctly.
And for example some results:
new Date("2014/01/01 00:59")
Date {Tue Dec 31 2013 23:59:00 GMT+0300} // wrong
new Date("2014/01/01 01:00")
Date {Wed Jan 01 2014 01:00:00 GMT+0400} // right
new Date("2003/01/01")
Date {Tue Dec 31 2002 23:00:00 GMT+0300} // wrong
new Date("2004/01/01")
Date {Thu Jan 01 2004 00:00:00 GMT+0300} // right
new Date("2020/01/01")
Date {Tue Dec 31 2019 23:00:00 GMT+0300} // wrong
new Date("2021/01/01")
Date {Fri Jan 01 2021 00:00:00 GMT+0300} // right
new Date("2025/01/01")
Date {Tue Dec 31 2024 23:00:00 GMT+0300} // wrong
new Date("2026/01/01")
Date {Thu Jan 01 2026 00:00:00 GMT+0300} // right
...
Chrome and Opera had the same problem in this years: 2003, 2014, 2020, 2025, etc.
Flags: needinfo?(yaatmb)
![]() |
||
Updated•10 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jwalden+bmo)
![]() |
||
Comment 5•10 years ago
|
||
> 2. I'm from Russia (Moscow Timezone "RTZ 2"). Timezone in Moscow was changed [26 October
> 2014 02:00] from GMT+4 to GMT+3
Oh, and this was a permanent change, not DST?
Thank you for the additional testcases; the difference between "2014/01/01 01:00" and "2014/01/01" definitely looks fishy to me.
Jeff, do we use our own timezone database, or an OS-provided one?
Starting from October 26, 2014 02:00 Russia change dymanic DST to permanent. More info http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jwalden+bmo)
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•