javascript 输出日期

var omydate = new Date();
	var iyear=omydate.getFullYear();
	var imonth=omydate.getMonth()+1;
	var idate=omydate.getDate();
	var iday=omydate.getDay();
	switch(iday){
		case 0:
			iday="星期日";
			break;
		case 1:
			iday="星期一";
			break;
		case 2:
			iday="星期二";
			break;
		case 3:
			iday="星期三";
			break;
		case 4:
			iday="星期四";
			break;
		case 5:
			iday="星期五";
			break;
		case 6:
			iday="星期六";
			break;
	}
	document.write(iyear+"年"+imonth+"月"+idate+"日"+" "+iday);
 
 
myhtml="哈哈哈哈  XXX  您好:今天是"+iyear+"年"+imonth+"月"+idate+"日"+"  "+ihours+":"+imin+":"+isec+"  "+iday;
		$("#timeat").html(myhtml);//jquery上用
		setTimeout("aa();",1000);

 

你可能感兴趣的:(JavaScript,html,jquery)