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 cannot find implementation of method formcreate 解决办法

Delphi xe 获取硬盘id序列号

Delphi 拷贝文件夹内所有内容

Delphi strutils.dupestring - 反复字符串

Delphi 在 webservice 中采用 tsoapattachment 传输文件

Delphi length 统计指定字符串的长度(即个数)

Delphi 模拟按键的一些误解

Delphi 键盘钩子的简单应用

Delphi 比较俩组mac地址

Delphi edit 让密码变成点

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



打赏

取消

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

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

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

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

评论

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