温柔网

 找回密码
 注册

查看: 602|回复: 0

中文日期

[复制链接]
发表于 2004-1-14 18:23:53 | 显示全部楼层 |阅读模式
<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>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|温柔网 ( 浙ICP备13033583号-8 )

GMT+8, 2024-11-23 16:13 , Processed in 0.036599 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表