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();
原文地址:https://www.cnblogs.com/amiezhang/p/7754917.html