js时间戳的简单介绍
<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>
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
