Home  >  Article  >  Web Front-end  >  A js code that can display the current year and zodiac_time and date

A js code that can display the current year and zodiac_time and date

WBOY
WBOYOriginal
2016-05-16 18:13:281135browse

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> function yeart(){ var now=new Date(); var year=now.getFullYear(); var ss=year-2008;//设定2008为初始年份 var ssc=ss%12; var ssyear=new Array("子鼠","丑牛","寅虎","卯兔","辰龙","巳蛇","午马","未羊","申猴","酉鸡","戌狗","亥猪"); document.write(year+"年 "+ssyear[ssc]); } </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn