javascript怎样获取系统当前时间
展开全部
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var date = myDate.getDate();
var dateArr = ["日","一",'二','三','四','五','六'];
var day = myDate.getDay();
var hours = myDate.getHours();
var minutes = formatTime(myDate.getMinutes());
var seconds = formatTime(myDate.getSeconds());
var systemTime = document.getElementById("time");
alert( " " + year + "年" + month +"月" + date + "日" + " 星期" + dateArr[day] + " " + hours + ":" + minutes + ":" + seconds);
var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var date = myDate.getDate();
var dateArr = ["日","一",'二','三','四','五','六'];
var day = myDate.getDay();
var hours = myDate.getHours();
var minutes = formatTime(myDate.getMinutes());
var seconds = formatTime(myDate.getSeconds());
var systemTime = document.getElementById("time");
alert( " " + year + "年" + month +"月" + date + "日" + " 星期" + dateArr[day] + " " + hours + ":" + minutes + ":" + seconds);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询