UTC转中文时间 http://space.flash8.net/space/?559871/action_viewspace_itemid_359366.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Date.prototype.toCHString=function(){ function getCH(Index){ return "零壹贰叁肆伍陆柒捌玖拾".charAt(Index); } function getCHStr(str,d){ var s=""; if(d=="年")for(var i=0;i<str.length;i++)s+=getCH(parseInt(str.substr(i,1))); else{ var iV=parseInt(str); if(iV%10==0)s+=(str.substr(0,1)=="1"?"":getCH(str.substr(0,1)))+getCH(10); else if(iV<10)s+=getCH(str.substr(0,1)); else s+=(str.substr(0,1)=="1"?"":getCH(str.substr(0,1)))+getCH(10)+getCH(str.substr(1,1)); } s+=d; return s; } //二OO八年十月十三日 十五时十二分零三秒 var result=getCHStr(this.getFullYear().toString(),"年") +getCHStr((this.getMonth()+1).toString(),"月") +getCHStr(this.getDate().toString(),"日")+"\t" +getCHStr(this.getHours().toString(),"时") +getCHStr(this.getMinutes().toString(),"分") +getCHStr(this.getSeconds().toString(),"秒"); return result;}var d=new Date();alert(d.toCHString()) 网页导航栏点击背景色更换 为什么引用jquery-1.4.4.js后有提示了 JS如何调用后台函数 session问题 关于作下拉菜单的一些Js问题 超有价值的问题,高手进来看看 netscape时,onkeypress的问题,解决即结贴,急! (急)下列框中能不能判断上次选择的值? 谁有用表格实现的文本滚动公告牌 这个‘|’是什么意思啊 复选框的js问题,求解 jQuery xml 排序
function getCH(Index){
return "零壹贰叁肆伍陆柒捌玖拾".charAt(Index);
}
function getCHStr(str,d){
var s="";
if(d=="年")for(var i=0;i<str.length;i++)s+=getCH(parseInt(str.substr(i,1)));
else{
var iV=parseInt(str);
if(iV%10==0)s+=(str.substr(0,1)=="1"?"":getCH(str.substr(0,1)))+getCH(10);
else if(iV<10)s+=getCH(str.substr(0,1));
else s+=(str.substr(0,1)=="1"?"":getCH(str.substr(0,1)))+getCH(10)+getCH(str.substr(1,1));
}
s+=d;
return s;
}
//二OO八年十月十三日 十五时十二分零三秒
var result=getCHStr(this.getFullYear().toString(),"年")
+getCHStr((this.getMonth()+1).toString(),"月")
+getCHStr(this.getDate().toString(),"日")+"\t"
+getCHStr(this.getHours().toString(),"时")
+getCHStr(this.getMinutes().toString(),"分")
+getCHStr(this.getSeconds().toString(),"秒");
return result;
}
var d=new Date();
alert(d.toCHString())