delphi 设置本地系统时间


本文整理自网络,侵删。

 
function SetLocalSysTime(const newTime:TDateTime):Boolean; //设置本地系统时间
var
  MyTime:TsystemTime;
begin
  FillChar(MyTime,sizeof(MyTime),#0);
  MyTime.wYear := StrToInt(FormatDateTime('yyyy', newTime));
  MyTime.wMonth := StrToInt(FormatDateTime('mm', newTime));
  MyTime.wDay := StrToInt(FormatDateTime('dd', newTime));
  MyTime.wHour := StrToInt(FormatDateTime('hh', newTime));
  MyTime.wMinute := StrToInt(FormatDateTime('nn', newTime));
  MyTime.wSecond := StrToInt(FormatDateTime('ss', newTime));
  Result := SetLocalTime(MyTime);
  //Result := SetSystemTime(MyTime);
end;

相关阅读 >>

Delphi 数组复制利用copymemory 最为完美

Delphi 屏幕渐变效果的源代码

Delphi 一个不错的枚举进程例子

Delphi隐藏进程

Delphi xe2读取内存偏移数据代码

Delphi 之 tpagecontrol组件

Delphi 如何快速读取非常大的文本文件

Delphi ado 连接mssql数据库

Delphi xe datasnap服务器获取客户端ip地址

Delphi 如何判断某一窗口最大化

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



打赏

取消

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

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

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

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

评论

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