Delphi 获取分解时间日期的年月日


本文整理自网络,侵删。

 

procedure TFrmLltj.FormActivate(Sender: TObject);
var
   Present: TDateTime;
   Year, Month, Day, Hour, Min, Sec, MSec:Word;
begin
   Present:= Now;
   DecodeDate(Present, Year, Month, Day);
   DecodeTime(Present, Hour, Min, Sec, MSec);
   Showmessage(DateToStr(Present)+' '+TimeToStr(Present,'hh'));//显示年月日时分秒
   Showmessage(formatdatetime('hh:mm',time));//显示时分
   cbb_qs_n.Text := inttostr(Year);//显示年
   cbb_qs_y.Text := inttostr(Month);//显示月
   cbb_qs_r.Text := inttostr(Day);//显示日
   cbb_qs_s.Text := IntToStr(Hour);//显示时
   cbb_qs_f.Text := IntToStr(Min);//显示分
 
 
end;
by huanfuChen

相关阅读 >>

Delphi 7 编写一个ie右键菜单项目:自动保存图片

Delphi ifileoperation替换shfileoperation

Delphi 关闭icesword等

Delphi 转换一批.bmp 文件为 .jpg

Delphi adoquery 开启本地缓存

Delphi adoquery filter使用

Delphi中使用临界区来让线程同步

Delphi如何获得当前操作系统语言环境

Delphi 检查屏幕是否处于锁屏或关闭状态

idftp无法设置transfertype属性

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...