Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 18:13:28
Original
1138 people have browsed it

[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>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template