怎么将"1922-2-12''转换成"一九贰贰年二月十二日"

ItOldHorse 2003-11-05 11:04:26
怎么将"1922-2-12''转换成"一九贰贰年二月十二日"

...全文
46 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
aiirii 2003-11-05
  • 打赏
  • 举报
回复
var s: string;
begin
S := FormatDateTime('yyyy年mm月d日', StrtoDate('1992/2/1'));
s := StringReplace(s, '1', '壹', [rfReplaceAll]);
s := StringReplace(s, '2', '貳', [rfReplaceAll]);
...
s := StringReplace(s, '0', '零', [rfReplaceAll]);
Showmessage(s);
end;
aiirii 2003-11-05
  • 打赏
  • 举报
回复
ysycrazy(风中狂) 的代碼, 估計
str:=FormatDateTime('yyyy年mm月dd日',strtodate('2003-11-5'));
執行就有問題了!!
aiirii 2003-11-05
  • 打赏
  • 举报
回复
mousefather(气死猫) :
說得沒錯, 是我失誤了!! 還要加些判斷!! 不知道是不是有些比較簡單的實現方式!!
ssq_td 2003-11-05
  • 打赏
  • 举报
回复
自己写个函数很简单的
mousefather 2003-11-05
  • 打赏
  • 举报
回复
没那么简单吧,2003-11-12要变成十一月十二日,如果用上面的程序变成了一一月一二日了
sunshine502108 2003-11-05
  • 打赏
  • 举报
回复
ding
ysycrazy 2003-11-05
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
var str:string;
begin
str:=FormatDateTime('yyyy年mm月dd日',strtodate('2003-11-5'));
str:=StringReplace(str,'1','壹',[rfReplaceAll]);
str:=StringReplace(str,'2','贰',[rfReplaceAll]);
str:=StringReplace(str,'3','叁',[rfReplaceAll]);
str:=StringReplace(str,'4','肆',[rfReplaceAll]);
str:=StringReplace(str,'5','伍',[rfReplaceAll]);
str:=StringReplace(str,'6','陆',[rfReplaceAll]);
str:=StringReplace(str,'7','柒',[rfReplaceAll]);
str:=StringReplace(str,'8','捌',[rfReplaceAll]);
str:=StringReplace(str,'9','玖',[rfReplaceAll]);
str:=StringReplace(str,'0','零',[rfReplaceAll]);
edit2.text:=str;
end;
lw549 2003-11-05
  • 打赏
  • 举报
回复
同意楼上。

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧