Date对象:
var today = new Date();
//年份:
var year = today.getFullYear();
//月份
var month = today.getMonth() + 1;
//日期
var day = today.getDate();
//时
var hour = today.getHours();
//分
var minute = today.getMinutes();
//秒
var seconds = today.getSeconds();
js内置对象中获取时间的用法--通过date对象获取。
志存高远,脚踏实地!