Question:
I want to change System time from my application immediatelly.
Do you have the code?

Answer:
Sure,
The input strings for date and time depends on the format you are using.


procedure TForm1.Button1Click(Sender: TObject);
var
SystemTime: TSystemTime;
NewTime, NewDate: string;
begin
NewTime := '12:00:00';
NewDate := '01.01.2006';
DateTimeToSystemTime(StrToDate(NewDate) + StrToTime(NewTime), SystemTime);
SetLocalTime(SystemTime);
// Tell windows, that the Time changed!
PostMessage(HWND_BROADCAST, WM_TIMECHANGE, 0, 0); // *
end;


5 Responses so far.

  1. daspeac says:

    I think you may also know about the outlook express inbox repair tool

Post a Comment

Thank you for your comment.

Any request and idea are welcome.

CLICK TO REGISTER