码迷,mamicode.com
首页 > Web开发 > 详细

js内置对象

时间:2018-05-27 20:56:09      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:0ms   对象   data   返回   eth   nbsp   console   date()   lis   

Date(时间对象)

  定义方式:var date = new Date()

  console.log(date.getTime());    返回距离1970/1/1 毫秒值

  console.log(date.getFullYear());    返回4为数的年份

  console.log(date.getMonth());       返回月份,从0开始

  console.log(date.getDate());         返回当月的第几天

  console.log(date.getHours());       返回小时0-23

  console.log(date.getMinutes());    返回分钟0-59

  console.log(date.getSeconds());   返回秒0-59

  console.log(data.getMilliseconds());  返回毫秒(1s=1000ms)

 

 

 

  

js内置对象

标签:0ms   对象   data   返回   eth   nbsp   console   date()   lis   

原文地址:https://www.cnblogs.com/yymxp/p/9097257.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!