Date对象常用方法

年月日:

var oDate = new Date()
//
oDate.getFullYear();
//月 返回的月份要+1才正常
oDate.getMonth()+1//
oDate.getDate();
//星期 (0~6对应‘日’到‘六’)
oDate.getDay();

时分秒:

var oDate = new Date()
//
oDate.getHours();
//
oDate.getMinutes(); 
//
oDate.getSeconds();

 

posted @ 2017-10-30 16:03  张啊咩  阅读(487)  评论(0编辑  收藏  举报