Ver Mensaje Individual
  #11  
Antiguo 13-05-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Cool Solución

Puesto que prefiero "controlar" mis aplicaciones con funciones propias simplificadas mías, hago lo de siempre... usar APIs: así que te dejo la (como siempre digo) "esencia" de lo que las funciones como el "Format" se valen. Acá están tus tres formatos...

Código Delphi [-]
function IntTo2(Value: Word): string;
begin
 Str(Value, Result);
 if Value < 10 then
  Result := '0' + Result;
end;
Código Delphi [-]

procedure TForm1.FormCreate(Sender: TObject);
var SystemTime: TSystemTime;
begin
 GetLocalTime(SystemTime);
 with SystemTime do
  Caption := IntTo2(wDay) + '/' + IntTo2(wMonth) + '/' + IntTo2(wYear) + ' - ' +
             IntTo2(wYear) + '-' + IntTo2(wMonth) + '-' + IntTo2(wDay) + ' y ' +
             IntTo2(wMonth) + '/' + IntTo2(wDay) + '/' + IntTo2(wYear);
end;


y para conversiones al con el TDateFormat usa las funciones:

Código Delphi [-]
 SystemTimeToDateTime
 DateTimeToSystemTime


Disfrútalas!
Responder Con Cita