如何得到一个时间的年月日? 如何得到一个时间的年月日? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 decodedate(Date,year,month,day);Date是你的日期,year,month,day是得到的年月日 procedure TMainForm.GetYMDTofDt(var y,m,d,t:string;dt:tdatetime);var dt_str:string;begin dt_str:= FormatDateTime('yyyy/mm/dd hh:mm:ss',dt); y:=copy(dt_str,1,4); m:=copy(dt_str,6,2); d:=copy(dt_str,9,2); t:=copy(dt_str,12,8);end; DecodeDate(Date: TDateTime; var Year, Month, Day: Word); dateof((const AValue: TDateTime): Word;monthof(const AValue: TDateTime): Word;yearof((const AValue: TDateTime): Word; 分布式数据开发,套间及同步问题 亲爱的DELPHI,暂别一阵子。。。。。 D2007下使用IdFTP 关于MAINMENU菜单控件的用法问题,判断checkde属性问题 暑假到了,内存坏了,Delphi跑不动了~[第一次散分] 哪有下载SQL语句或讲解大全的电子书?“ 对数据模块的疑问 Delphi用ADOQuery控件连接ACCESS数据库时,如何使SQL语句被立即执行??? 求教一个问题 紧急求助:有关字体设置问题 请大家帮忙! 怎么样用循环与语句取得控件名?
Date是你的日期,year,month,day是得到的年月日
var
dt_str:string;
begin
dt_str:= FormatDateTime('yyyy/mm/dd hh:mm:ss',dt);
y:=copy(dt_str,1,4);
m:=copy(dt_str,6,2);
d:=copy(dt_str,9,2);
t:=copy(dt_str,12,8);
end;
monthof(const AValue: TDateTime): Word;
yearof((const AValue: TDateTime): Word;