// js
const formatData = date => {
const year = date.getFullYear()
const month = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
}
this.setData({
nowTime: formatData(new Date())
})
08-31
1483
10-14
6611
12-14
7178
03-23
2162
08-12
1万+