new Date() sets wrong month

前端 未结 1 1547
耶瑟儿~
耶瑟儿~ 2021-01-29 09:30

I want to parse a string (or even the ints) at the new Date() function, but see what happens:

date = \"2015-12-13\"
\"2015-12-13\"
date
\"2015-1         


        
相关标签:
1条回答
  • 2021-01-29 09:40

    Month dates start at 0 in javascript, so 0 would be January and 11 would be December in your example.

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