Link to home
Start Free TrialLog in
Avatar of d32coder
d32coder

asked on

System Time

I'm writing a network app and I need to sychronize the system times on all the nodes with the server.

All I really need is the source code to set the system Date/Time locally.

Don
Avatar of marcoszorrilla
marcoszorrilla

Try this function.


procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=GetsystemTimeUtc()
end;


function GetSystemTimeUTC : String;
var
   stSystemTime : TSystemTime;
begin
   Windows.GetSystemTime( stSystemTime );
   Result := DateTimeToStr( SystemTimeToDateTime( stSystemTime ) );
end;

Avatar of d32coder

ASKER

Not quite.  I want to SET the time.

Don
ASKER CERTIFIED SOLUTION
Avatar of marcoszorrilla
marcoszorrilla

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!

Don