Buscar

Alterar a data do sistema

Código

Procedure TForm1.Button1Click(Sender: TObject);
begin
  SetNewTime(1998,2,10,18,07);
end;

function SetNewTime(Ano, Mes, Dia, hour, minutes: word): Boolean;
var
st:TSYSTEMTIME;
begin
  GetLocalTime(st);
  st.wYear := Ano;
  st.wMonth := Mes;
  st.wDay := Dia;
  st.wHour := hour;
  st.wMinute := minutes;
  if not SetLocalTime(st) then
  Result := False
  else
  Result := True;
end;
   
 
 

Publicidade

Vote na dica




Quantidade de votos: 0 votos
Aceitação: 0%


Detalhes da dica

Categoria: Object pascal
Adicionada dia: 29/07/03
Por: Carlos Renato Pereira Zen
Visualizada: 1970 vezes

Planeta Delphi - Tudo sobre programação Delphi Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009