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 xe6调用android手机标准功能

Delphi memo1删除前n行

Delphi 给变量加引号

Delphi 服务端日志记录

Delphi deletedirectory 删除目录下所有文件包括子文件夹下所有文件

Delphi 禁止改变窗口大小和移动窗口

Delphi简单的播放声音

Delphi url protocol 让浏览器运行本地的exe程序

Delphi 让子窗体显示在任务栏上

Delphi tstream 详细介绍

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



打赏

取消

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

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

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

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

评论

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