private string timeStr(string timeStr)
{
int len=timeStr.Length;
int i=0;
int j=0;
string timeStr1="";
while(i<len)
{
string chStr=timeStr.Substring(i,1);
switch(chStr)
{
case "0":
timeStr1+="○";
break;
case "1":
timeStr1+="一";
break;
case "2":
timeStr1+="二";
break;
case "3":
timeStr1+="三";
break;
case "4":
timeStr1+="四";
break;
case "5":
timeStr1+="五";
break;
case "6":
timeStr1+="六";
break;
case "7":
timeStr1+="七";
break;
case "8":
timeStr1+="八";
break;
case "9":
timeStr1+="九";
break;
case "-":
j++;
if(j==1)
timeStr1+="年";
if(j==2)
timeStr1+="月";
break;
}
i++;
}
if(timeStr1.Length!=0)
timeStr1+="日";
return timeStr1;
}
转中文日期
最新推荐文章于 2021-04-09 00:55:52 发布