Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Countdown Funktion (https://www.delphipraxis.net/460-countdown-funktion.html)

Frankle 25. Jul 2002 15:37


Countdown Funktion
 
Hallo!
Ich suche eine Funktion...an dich ich 2 Daten übergebe (das 2. ist das aktuelle) und die Funktion soll dann ausspucken...wie lange noch Zeit ist! Sprich: 1T 2Std 3M

Dankööööö

jbg 25. Jul 2002 16:16

Code:
procedure TimeDiffStr(dt1, dt2: TDateTime): string;
var h, m, s, s100: Word;
begin
  dt1 := dt2 - dt1;
  DecodeTime(dt1, h, m, s, s100);
  Result := IntToStr(Trunc(dt1)) + ' Tage ' +
            IntToStr(h) + ' Stunden ' +
            IntToStr(m) + ' Minuten ';
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz