标签:
var d1 = new Date(2015, 4, 31) var d2 = new Date(2015, 4, 32) var d3 = new Date(2015, 4, -1) console.log(d1) console.log(d2) console.log(d3) console.log(d1.getDate(), d1.getMonth() + 1) console.log(d2.getDate(), d2.getMonth() + 1) console.log(d3.getDate(), d3.getMonth() + 1) /* Sun May 31 2015 00:00:00 GMT+0800 (中国标准时间) Mon Jun 01 2015 00:00:00 GMT+0800 (中国标准时间) Wed Apr 29 2015 00:00:00 GMT+0800 (中国标准时间) 31 5 1 6 29 4 */
标签:
原文地址:http://www.cnblogs.com/jzm17173/p/4487544.html