6.2.7 Date的使用

创建日期对象

var myDate=new Date();

console.log(myDate.getDate())   //获取一个月中的某一天 1-31

console.log(Date())  //获取当天的日期时间 

console.log(getMonth() + 1)

console.log(myDate.getDay()) //周二2 周日 0

getFullYear()

getHours()

getMinutes()

getSeconds()

setDate()

toString() 将Date对象转换成字符串对象

 

posted @ 2018-07-21 10:11  beallaliu  阅读(96)  评论(0编辑  收藏  举报