js Date

...

// Date 对象用于处理日期和时间。
// http://www.w3school.com.cn/jsref/jsref_obj_date.asp
var myDate=new Date();
document.write(myDate);
/*
    Date()     返回当日的日期和时间。
    getFullYear()     从 Date 对象以四位数字返回年份。
    getMonth()     从 Date 对象返回月份 (0 ~ 11)。
    getDate()     从 Date 对象返回一个月中的某一天 (1 ~ 31)。
    getDay()     从 Date 对象返回一周中的某一天 (0 ~ 6)。
    
    getHours()     返回 Date 对象的小时 (0 ~ 23)。
    getMinutes()     返回 Date 对象的分钟 (0 ~ 59)。
    getSeconds()     返回 Date 对象的秒数 (0 ~ 59)。
    getMilliseconds()     返回 Date 对象的毫秒(0 ~ 999)。
    ......
*/

 

posted @ 2019-01-16 15:44  SilentKiller  阅读(84)  评论(0)    收藏  举报