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()

扫描二维码关注公众号,回复: 2285051 查看本文章

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

猜你喜欢

转载自www.cnblogs.com/beallaliu/p/9345719.html