let time = new Date(); let year = time.getFullYear(); //年 let month = time.getMonth(); //月 let date = time.getDate(); //号 let day = time.getDay(); //星期 let hourse = time.getHours(); //时 let minutes = time.getMinutes(); //分 let seconds = time.getSeconds(); //秒 console.log(` ${year}年 ${month+1}月 ${date}号 星期${day} `) console.log(` ${hourse}点 ${minutes}分 ${seconds}秒 `)