首页 > 其他 > 详细

全中文日期显示

时间:2014-11-05 12:30:13      阅读:183      评论:0      收藏:0      [点我收藏+]
<!--脚本说明:
把如下代码加入<body>区域中:--亿诚-石家庄展柜>
<script language="JavaScript">
function number(index1){
var numberstring="一二三四五六七八九十";
if(index1 ==0) {document.write("")}
if(index1 < 10){
document.write(numberstring.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write(""+numberstring.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+numberstring.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+numberstring.substring(0+(index1-31),(index1-30)))}
}
var today1 = new Date()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("公元二零零零年")
number(month)
document.write("")
number(date)
document.write("")
</script>
<!--脚本说明:
把如下代码加入<body>区域中:-->
<script language="JavaScript">
function number(index1){
var numberstring="一二三四五六七八九十";
if(index1 ==0) {document.write("")}
if(index1 < 10){
document.write(numberstring.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write(""+numberstring.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+numberstring.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+numberstring.substring(0+(index1-31),(index1-30)))}
}
var today1 = new Date()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("公元二零零零年")
number(month)
document.write("")
number(date)
document.write("")
</script>

 

全中文日期显示

原文:http://www.cnblogs.com/youtianxia/p/4075919.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!