如何用js代码实现今年是牛年

来源:百度知道 编辑:UC知道 时间:2024/06/19 18:28:44
我想做个显示时是:现在时间是:2009年4月30日 15时46分50秒 今年是:牛年
请帮忙

<script>
var curt = new Date();
var sx = ["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"];
var str = curt.getFullYear()+"年"+(curt.getMonth()+1)+"月"+curt.getDate()+"日 "+curt.getHours()+"时"+curt.getMinutes()+"分"+curt.getSeconds()+"秒 ";
str += "今年是:" +sx[(curt.getFullYear()+8)%12]+"年"
document.write(str);
</script>

<html>
<head>
<title>网页特效|Linkweb.cn/Js|---农历日历</title>
</head><body>
<script language="Livescript">
<!--hiding
today=new Date()
document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日 ")
document.write("")
now=new Date()
document.