zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Date对象常用方法

方法对象 常用 Date
2023-09-14 08:58:55 时间

年月日:

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