Is the Javascript date object always one day off?

后端 未结 23 2362
既然无缘
既然无缘 2020-11-22 01:49

In my Java Script app I have the date stored in a format like so:

2011-09-24

Now when I try using the above value to create a new Date obje

23条回答
  •  难免孤独
    2020-11-22 02:15

    It means 2011-09-24 00:00:00 GMT, and since you're at GMT -4, it will be 20:00 the previous day.

    Personally, I get 2011-09-24 02:00:00, because I'm living at GMT +2.

提交回复
热议问题