当前位置: 代码迷 >> JavaScript >> JS打印汉语日期
  详细解决方案

JS打印汉语日期

热度:394   发布时间:2012-10-09 10:21:45.0
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>
  相关解决方案