JS打印中文日期

 

<script language="javascript" type="text/javascript">
function The_date() {var Today = new Date(); var year = Today.getYear(); year=(year<1900?(1900+year):year); var month= Today.getMonth(); var date = Today.getDate(); var day = Today.getDay(); switch(day) {case 1:day="星期一";break; case 2:day="星期二";break; case 3:day="星期三";break; case 4:day="星期四";break; case 5:day="星期五";break; case 6:day="星期六";break; case 0:day="星期日";break; } document.write(year+"年"); document.write(month+1); document.write("月"+date+"日 "); document.write(day); }
</script>

你可能感兴趣的:(JavaScript)