现在的位置: 首页 > 综合 > 正文

解决FF中JS的时间错误

2018年01月27日 ⁄ 综合 ⁄ 共 354字 ⁄ 字号 评论关闭

<script language="javascript">today=new Date(); var tdate,tday, x,year; var x = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五","星期六");
var MSIE=navigator.userAgent.indexOf("MSIE");
 if(MSIE != -1)
     year =(today.getYear());
else
    year = (today.getYear()+1900);
tdate= year+ "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日" + " " + x[today.getDay()];
document.write(tdate); </script>

抱歉!评论已关闭.