console 命令行工具
X
clear
> "2025-05-23T14:16:19.506Z",2025,5
> 2025年5月23日星期五14:16:19
console
var date = new Date()
const nowYear = date.getFullYear()
const nowMonth = date.getMonth() + 1
const nowDate = date.getDate()
const weekDay = ['星期天','星期一','星期二','星期三','星期四','星期五','星期六','星期天']
const nowWeek = weekDay[date.getDay()]
const nowHour = date.getHours()
const nowMinute = date.getMinutes()
const nowSecond = date.getSeconds()
console.log(date,nowYear,nowMonth)
console.log(nowYear + '年' + nowMonth + '月'+ nowDate +'日'+ nowWeek + nowHour + ':' + nowMinute + ':' + nowSecond)