setDate() set the wrong date on 31st?

后端 未结 4 1823
刺人心
刺人心 2021-01-15 04:12

This is very weird I don\'t know what I\'m doing wrong. I have a function to grab the date (i.e in this format: 06/24/2011), here\'s the function:



        
4条回答
  •  天涯浪人
    2021-01-15 04:55

    Why are you adding 1 the day position (position 1)? I think that is your problem.

    d.setDate(dspl[1] + 1);
    

提交回复
热议问题