本文整理自网络,侵删。
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 xe datasnap服务器获取客户端ip地址
更多相关阅读请进入《Delphi》频道 >>