以下是我必须找到几个月的两个日期。
Sun Mar 01 2015 05:30:00 GMT+0530 (IST)
Tue Sep 01 2015 05:30:00 GMT+0530 (IST)
我搜索了很多,但没有人代表上述格式。帮我解决这个问题。提前致谢。
答案 0 :(得分:1)
var date = new Date('Sun Mar 01 2015 05:30:00 GMT+0530');
var date1 = new Date('Tue Sep 01 2015 05:30:00 GMT+0530');
var diff = date1.getMonth() - date.getMonth();
console.log(diff)