代码拉取完成,页面将自动刷新
/**
* Date对象
*/
// 创建时间处理对象
var date = new Date();
// 返回当前时间
console.log(date); // 2020-05-05T11:54:49.275Z
// 获取当前对象的时间戳,从1970年1月1日0:0:0到当前日期花费的'毫秒数'
console.log(date.getTime()); // 1520216319647
// 获取当前的时间戳
console.log(Date.now()); // 1520216602433
// 获取当前对象是几日,如今天为5月5日,则返回5
console.log(date.getDate()); // 5
// 获取当前日期为周几: 0表周日 1表示周一 ... 6表示周六
console.log(date.getDay()); // 3
// 获取当前月份0-11的值
console.log(date.getMonth()); // 4
// 获取当前年份
console.log(date.getFullYear()); // 2020
// 获取当前小时、分钟、秒数...
console.log(date.getHours()); // 2020
console.log(date.getMinutes()); // 4
console.log(date.getMilliseconds()); // 595
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。