Thema: Delphi Zeit aus ini zurück

Einzelnen Beitrag anzeigen

Vjay

Registriert seit: 2. Dez 2003
Ort: Berlin/Eschede
481 Beiträge
 
Delphi 7 Professional
 
#8

Re: Zeit aus ini zurück

  Alt 20. Jun 2008, 13:48
Delphi-Quellcode:
function vDateToStr( const date: TDateTime): string;
begin
 DateTimeToString(result, 'yyyy.mm.dd hh:nn:ss', date);
end;

function vStrToDate( const s1: string): TDateTime;
begin
 result:= encodeDateTime( strToIntDef(copy(s1, 1, 4), 0),
                          strToIntDef(copy(s1, 6, 2), 0),
                          strToIntDef(copy(s1, 9, 2), 0),
                          strToIntDef(copy(s1, 12, 2), 0),
                          strToIntDef(copy(s1, 15, 2), 0),
                          strToIntDef(copy(s1, 18, 2), 0), 0);
end;
Ich mache es so, hat den Vorteil, dass es menschenlesbar ist.
Wer später bremst ist eher tot.
  Mit Zitat antworten Zitat