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;

相关阅读 >>

Delphi 日期时间函数

Delphi textfile读取文本文件

Delphi 2009 新增单元 character[1]: toupper、tolower - 字符与字符串的大小写转换

Delphi combobox 下拉事件

Delphi psafearray与tbytes类型转换

tstrings 的用法

Delphi getprocessidentity 获取当前登录状态的管理员

Delphi cxgrid:动态设计统计功能

Delphi申请和释放内存

Delphi excel数据导入数据库表

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



打赏

取消

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

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

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

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

评论

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