js的日期计算
//当前日期
var now = new Date();
//今天是本周的第几天。周一=0,周日=6
var nowDayOfWeek = (now.getDay() == 0) ? 7 : now.getDay() - 1;
//当前日
var nowDay = now.getDate();
//一周中的星期值;0为星期天,1为星期一、2为星期二,依此类推
getDay()
//当前月值(1月=0,12月=11)
var nowMonth = now.getMonth();
//当前月实际数字
var nowMonReal = now.getMonth() + 1;
//当前年
var nowYear = now.getFullYear();
//获取当前季度
currQuarter = Math.floor( ( currMonth % 3 == 0 ? ( currMonth / 3 ) : ( currMonth / 3 + 1 ) ) );
//小时值。
getHours()
//分钟值
getMinutes()
//秒数值。
getSeconds()
//毫秒值。
getMilliseconds()
//返回Date对象与'1970/01/01 00:00:00'之间的毫秒值(北京时间的时区为东8区,起点时间实际为:'1970/01/01 08:00:00') 。
getTime() :