当前位置:开发者网络 >> 技术教程 >> ASP教程 >> 脚本编码 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
日期转大写的代码
作者:未知
日期:2005-09-14
人气:
投稿:(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:

'2004-6-11 => 二零零四年六月十一日
Function D(x)
 if int(split(x,"-")(2)/10)=0 then D=D & F(split(x,"-")(2)) else _
 if split(x,"-")(2) mod 10 =0 then D=D & F(int(split(x,"-")(2)/10)) & "十" else _
 D=D & F(int(split(x,"-")(2)/10)) & "十" & F(split(x,"-")(2) mod 10)
 D=F(split(x,"-")(0)) & "年" & MonthName(split(x,"-")(1),True) & replace(D,"一十","十") & "日"
end Function

Function F(x)
 for i=1 to len(x)
  if mid(x,i,1)="0" then F=F & "零" else F=F & left(MonthName(mid(x,i,1),True),1)
 next
end Function

msgbox D(Date)

相关文章: