前端提取中国标准时间中的年份
程序员文章站
2022-06-07 14:28:34
...
const year =this.yearold.getFullYear();
const month = this.yearold.getMonth()+1;
const date = this.yearold.getDate();
const hours = this.yearold.getHours()
const minutes = this.yearold.getMinutes();
const seconds = this.yearold.getSeconds();
console.log(year+"年"+month+"月"+date+"日"+hours+"时"+minutes+"分"+seconds+"秒");