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();
时间: 2024-11-05 16:03:35