toLocaleDateString
- var date = new Date(‘Thu May 12 2016 08:00:00 GMT+0800 (中国标准时间)‘);
- formatTime=date.getFullYear() + ‘-‘ + (date.getMonth() + 1) + ‘-‘ + date.getDate() + ‘ ‘ + date.getHours() + ‘:‘ + date.getMinutes() + ‘:‘ + date.getSeconds();
来不及了,先记下
原文:http://www.cnblogs.com/yourstars/p/6523061.html