set (Adjust) system Time

How to Set (Adjust ) windows Clock (Date And Time ) programaticlly
Prof_MAMAsked:
Who is Participating?
 
BlackTigerXConnect With a Mentor Commented:
var
  st:TSystemTime;
begin
  DateTimeToSystemTime(Now, st); //change "Now" by the time you want to change it to
  Windows.SetLocalTime(st) //and this function takes care of actually changing the time
end;
0
 
BlackTigerXCommented:
just note that you need to have some specific privileges if the code runs in a NT OS
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.