<script>
// 时间戳就是从1970年1月1号0点0时0分0秒开始到现在的毫秒数
var time = new Date()
console.log(time.getTime());
// 获取年
console.log(time.getFullYear());
// 获取月
console.log(time.getMonth() + 1);
// 获取天
console.log(time.getDay());
// 获取小时
console.log(time.getHours());
// 获取分钟
console.log(time.getMinutes());
// 获取秒钟
console.log(time.getSeconds());
</script>
js时间戳的简单介绍
最新推荐文章于 2023-04-11 15:42:25 发布