Change the system date  

Send By: J. Jesús Anaya Ramírez
Web : N.A.
Email: anaya@globalpc.net
Date: 16/01/00

Tip accessed 428 times

 


Here you have a procedure to change the date of your PC from your Delphi Application:



 procedure TForm1.Button1Click(Sender: TObject);

   procedure FechaDelSistema(Fecha: TDateTime);
   var
     FecSys: TSystemTime;
     nA, nM, nD: Word;
   begin
     DecodeDate(Fecha, nA,nM,nD);
     GetLocalTime(FecSys);
     FecSys.wYear  := nA;
     FecSys.wMonth := nM;
     FecSys.wDay   := nD;
     SetLocalTime(FecSys);
   end;
 begin
   FechaDelSistema( StrToDate('23/08/2002') );
 end;