2

I get inconsistent timezone based on params to Date():

new Date()
Sun Oct 25 2015 18:10:42 GMT+0200 (IST)

new Date(1445720400)
Sat Jan 17 1970 19:35:20 GMT+0200 (IST)

new Date(144572040000)
Thu Aug 01 1974 09:54:00 GMT+0300 (IDT)

new Date(14457204000000)
Thu Feb 17 2428 20:00:00 GMT+0200 (IST)

I tried reading the docs or finding an explanation to this weirdness, but couldn't. I've checked on both Chrome 46 and Safari 7.1.8, Any ideas?

Yaron
  • 2,053
  • 2
  • 19
  • 21

2 Answers2

4

Isn't this just daylight savings? One of the dates happened to be in the summer?

andrrs
  • 2,289
  • 3
  • 17
  • 25
  • Yes! Just realized that and came back to answer my own questions. Very very silly of me! – Yaron Oct 25 '15 at 16:35
0

The problem in then you set different time in ms as param for 'new Date()'. And you have different time zones because the Date has been generated in different seasons (Summer's time and Winter's time). It is normal.

yavor.makc
  • 87
  • 1
  • 2