网站运行年月统计代码

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

参加工作:<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>

相关文章

此处评论已关闭