网站运行年月统计代码

网站运行年月统计代码、累计年月统计代码:

参加工作:<script language="Javascri&#112;t" type="text/javascri&#112;t">

now = new Date()

nowyear=now.getFullYear()

if(nowyear<2000)

nowyear=nowyear+1900

nowmonth=now.getMonth()+1

nowdate=now.getDate()

years=nowyear-2010               //出生那年

months=nowmonth-03             //出生那月

dates=nowdate-02                  //出生那天

if((years<0)||((years==0)&&(months<0))||((years==0)&&(months==0)&&(dates<=0)))

document.write("<span><font color=red>系统时间有误!</font></span>")

else {

if(dates<0) {

months=months-1

dates=dates+30

}

if(months<0) {

years=years-1

months=months+12

}

document.write("<span><font color=red><b>")

if (years>0) {

document.write(years)

document.write("</b></font>年<font color=red><b>")

}

if(months>0) {

document.write(months)

document.write("</b></font>月<font color=red><b>")

}

if(((years>0)||(months>0))&&(dates>0))

document.write("")

if(dates>0) {

document.write(dates)

document.write("</b></font>天")

document.write("</span>")

}

else

document.write("</b></font>整")

document.write("</span>")

}

</script>

本文最后更新于 2011-09-15 11:32:31 并被添加「js」标签,已有 5980 位童鞋阅读过。
本文作者:未来往事
本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处

相关文章

此处评论已关闭