delphi中设置系统时间方法


本文整理自网络,侵删。

 

//delphi中设置系统时间方法

var       
    systemtime:Tsystemtime;  
  DateTime:TDateTime;  
begin  
  DateTime:=StrToDateTime(Edit1.text);   //获得时间(TDateTime格式)  
  DateTimeToSystemTime(DateTime,systemtime);   //把Delphi的TDateTime格式转化为API的TSystemTime格式  
  SetLocalTime(SystemTime);   //设置系统时间  
  GetLocalTime(SystemTime);   //读取系统时间  
  DateTime:=SystemTimeToDateTime(SystemTime);   //把API的TSystemTime格式   转化为   Delphi的TDateTime格式  
  Edit2.Text:=DateTimeToStr(DateTime);   //显示当前系统的时间  
end;  

相关阅读 >>

Delphi inifile to xml

Delphi checklistbox用法

Delphi 简单播放mp3

Delphi idftp 错误:socket error 10054 �c connection reset by peer -连接被重置

Delphi单元文件基本结构

Delphi trayicon1如何把窗体关闭到系统托盘

Delphi 10.3.1新的变量的声明方法

Delphi winapi: loadstring - 从资源中载入字符串

剪贴板单元 clipboards.pas

Delphi vclzip实现分卷压缩

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



打赏

取消

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

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

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

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

评论

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