相思资源网 Design By www.200059.com
复制代码 代码如下:
<script type="text/javascript">
function initArray(){
this.length=initArray.arguments.length;
for(var i=0;i<this.length;i++){
this[i]=initArray.arguments[i];
}
}
var strA="";
function TimeList()
{
var i=0;
var str=new Array("零","壹","贰","叁","肆","伍","陆","妻","捌","玖");
var str2=new Array("一","二","三","四","五","六","七","八","九","十");
var str3=new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
var time=new Date();
var year=new initArray(time.getFullYear().toString().split("")[0],time.getFullYear().toString().split("")[1],time.getFullYear().toString().split("")[2],time.getFullYear().toString().split("")[3]);
//var year=eval(time.getFullYear().toString());
var month;
if(time.getMonth().toString().length>1)
{
month=new initArray(time.getMonth().toString().split("")[0],time.getMonth().toString().split("")[1]);
}
else
{
month=new initArray(time.getMonth().toString().split("")[0]);
}
var len=year.length;
for(i=0;i<4;i++) //年
{
var k=parseInt(year[i]);
strA+=str[k];
}
strA+="年";
var j=0;
var strB="";
if(month.length>1)
{
strB+=str2[9];
strB+=str2[parseInt(time.getMonth().toString().split("")[1])];
}
else
{
strB+=str2[parseInt(time.getMonth().toString().split("")[0])];
}
strA+=strB;
strA+="月";
var strD="";
if(time.getDate().toString().length>1)
{
if(parseInt(time.getDate().toString().split("")[0])>1)
{
strD+=str2[parseInt(time.getDate().toString().split("")[0])-1];
strD+=str2[9];
if(parseInt(time.getDate().toString().split("")[1])>0)
{
strD+=str2[parseInt(time.getDate().toString().split("")[1])-1];
}
else
{
strD+="";
}
}
else
{
if(parseInt(time.getDate().toString().split("")[1])==0)
{
strD+="初";
strD+=str2[9];
}
else
{
strD+=str2[9];
strD+=str2[parseInt(time.getDate().toString().split("")[1])-1];
}
}
}
else
{
strD+="初";
strD+=str2[parseInt(time.getDate().toString().split("")[0])-1];
}
strA+=strD;
strA+=" ";
var sta=time.getDay();
strA+=str3[sta];
document.getElementById("Text1").value=strA;
document.getElementById("TextBox1").innerText=strA;
document.all.Label1.innerText=strA;
document.form1.TextBox2.innerText=strA;
}
</script>
<script type="text/javascript">
function initArray(){
this.length=initArray.arguments.length;
for(var i=0;i<this.length;i++){
this[i]=initArray.arguments[i];
}
}
var strA="";
function TimeList()
{
var i=0;
var str=new Array("零","壹","贰","叁","肆","伍","陆","妻","捌","玖");
var str2=new Array("一","二","三","四","五","六","七","八","九","十");
var str3=new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
var time=new Date();
var year=new initArray(time.getFullYear().toString().split("")[0],time.getFullYear().toString().split("")[1],time.getFullYear().toString().split("")[2],time.getFullYear().toString().split("")[3]);
//var year=eval(time.getFullYear().toString());
var month;
if(time.getMonth().toString().length>1)
{
month=new initArray(time.getMonth().toString().split("")[0],time.getMonth().toString().split("")[1]);
}
else
{
month=new initArray(time.getMonth().toString().split("")[0]);
}
var len=year.length;
for(i=0;i<4;i++) //年
{
var k=parseInt(year[i]);
strA+=str[k];
}
strA+="年";
var j=0;
var strB="";
if(month.length>1)
{
strB+=str2[9];
strB+=str2[parseInt(time.getMonth().toString().split("")[1])];
}
else
{
strB+=str2[parseInt(time.getMonth().toString().split("")[0])];
}
strA+=strB;
strA+="月";
var strD="";
if(time.getDate().toString().length>1)
{
if(parseInt(time.getDate().toString().split("")[0])>1)
{
strD+=str2[parseInt(time.getDate().toString().split("")[0])-1];
strD+=str2[9];
if(parseInt(time.getDate().toString().split("")[1])>0)
{
strD+=str2[parseInt(time.getDate().toString().split("")[1])-1];
}
else
{
strD+="";
}
}
else
{
if(parseInt(time.getDate().toString().split("")[1])==0)
{
strD+="初";
strD+=str2[9];
}
else
{
strD+=str2[9];
strD+=str2[parseInt(time.getDate().toString().split("")[1])-1];
}
}
}
else
{
strD+="初";
strD+=str2[parseInt(time.getDate().toString().split("")[0])-1];
}
strA+=strD;
strA+=" ";
var sta=time.getDay();
strA+=str3[sta];
document.getElementById("Text1").value=strA;
document.getElementById("TextBox1").innerText=strA;
document.all.Label1.innerText=strA;
document.form1.TextBox2.innerText=strA;
}
</script>
标签:
javascript,日期,中文
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无javascript 当前日期转化为中文的实现代码的评论...