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 winapi: getwindowtext - 获取窗口标题

Delphi 校验文件大小

xp/2003下Delphi最简单的方法开放3389

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

Delphi sendemail 邮件发送单元

Delphi读写文本文件

Delphi timage保存图片到stream及从stream中取图片

Delphi中inputbox 和inputquery 函数的使用

Delphi一个基于wininet的http操作小函数

在一个exe文件中查找指定内容,找到则返回起始位置,否则返回0

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



打赏

取消

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

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

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

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

评论

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