js实现获取当前星期和日期

var weekarr = new Array("日", "一", "二", "三", "四", "五", "六");
var myDate=new Date();
var year=myDate.getFullYear();
var month=myDate.getMonth()+1;
var date=myDate.getDate();
var hours = myDate.getHours();
$('.jp_week').text('星期' + weekarr[new Date().getDay()]);
$('.jp_date').text(year + '/' + month + '/' + date );

你可能感兴趣的:(js,css,javascript,前端,html)