本帖最后由 道缘菩提 于 2008-12-14 16:01 编辑
演示:http://www.hzfj.org/home
<td width="26%"><font color="#A52A2A">今天是
<script language=javascript>
<!--
var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var isnDays=new initArray("SUN","MON","TUE","WED","THU","FRI","SAT","SUN");
today=new Date();
function initArray()
{
for(i=0;i<initArray.arguments.length;i++)
this=initArray.arguments;
}
function getFullYear(d)
{//d is a date object
yr = d.getYear();
if(yr<1000) yr += 1900;
return yr;
}
document.write(getFullYear(today) +"年" + isnMonths[today.getMonth()] + "" + today.getDate()+"日");
//-->
</script>
<!--倒计时开始 -->
<script language="JavaScript">
var urodz= new Date("1/26/2009");
var s="离春节";
var now = new Date();
var ile = urodz.getTime() - now.getTime();
var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
if (dni > 1)
document.write(""+s+"还有"+dni +"天")
else if (dni == 1)
document.write("离春节只有2天啦!")
else if (dni == 0)
document.write("离春节只有1天啦!")
else
document.write("好象已经过了哦!");
</script>
</font></td>
演示:http://www.hzfj.org/home |