Wrong date from timestamp

后端 未结 4 1508
独厮守ぢ
独厮守ぢ 2021-01-21 18:20

I have a problem which can\'t solve by myself.

Here is timestamp 1308085200 taken from my website database. It represents 2011-06-15 12:00:00

Here is javascrip

4条回答
  •  轮回少年
    2021-01-21 18:43

    Well, JavaScript's getMonth() function sucks and starts with 0 for January. You have to add one.

    Maybe you want to use date js, since it fixes some of these problems.

提交回复
热议问题