倒计时线上地址 倒计时
date对象
Date 对象用于处理日期与时间。
创建 Date 对象: new Date()
-
var now =new Date();//拿到的是电脑的本机时间
-
var year=now.getFullYear();//获取年;
-
var month=now.getMonth();//获取月;跟正常的月差1;6代表7月
-
var date = now.getDate();//获取几号;
-
var day =now.getDay();//获取星期几;0——》日 1-》周一 2-》周二
-
var hour=now.getHours();//获取小时(24小时制)
-
var minutes =now.getMinutes();//获取分钟
-
var second = now.getSeconds();//获取秒
-
var miniSecond = now.getMilliseconds();//获取毫秒;
var t =now.getTime();//获得当前时间距离1970-0-0 0:0:0 的毫秒数
var oDiv=document.getElementById('div1')
var now = new Date();
var year = now.getFullYear();//年
var month = now.getMonth()+1;//月