我正在使用 Delphi BDS2006 如何格式化日期(01/10/2011)看起来像
1st Oct 2011
我尝试使用
ShowMessage(FormatDateTime('ddd mmm yyyy', now));
我得到的信息是Sat Oct 2011
ddd
给我Sat
而不是1st
我想添加st,nd,rd,th
到日期的类似方式
是否有内置程序或功能来执行此操作,或者我必须手动检查日期并为其分配后缀
我目前正在使用这个
case dayof(now)mod 10 of
1 : days:=inttostr(dayof(dob))+'st';
2 : days:=inttostr(dayof(dob))+'nd';
3 : days:=inttostr(dayof(dob))+'rd';
else days:=inttostr(dayof(dob))+'th';
end;