Why is there an about 30 days missing in JS Date Difference Script

前端 未结 1 880
醉话见心
醉话见心 2020-12-07 05:26

I am currently learning JavaScript and Jquery and I came across a solution to subtract 2 dates from each other. However, the result is short of 30 days. How come? What am I

1条回答
  •  一向
    一向 (楼主)
    2020-12-07 06:24

    Javascript months are zero-based.

    December is 11.
    12 will wrap around and become January of the next year.

    0 讨论(0)
提交回复
热议问题