Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Datum auf Syntax überprüfen (https://www.delphipraxis.net/58541-datum-auf-syntax-ueberpruefen.html)

Union 9. Dez 2005 09:29

Re: Datum auf Syntax überprüfen
 
Und so geht es Exceptionfrei UND Thread Safe:
Delphi-Quellcode:
uses MaskUtils; // Für MaskDoFormatText
var
   Datum : TDateTime;
   FS : TFormatSettings;
begin
   GetLocaleFormatSettings(0, FS);
   FS.ShortDateFormat := 'yy.mm.dd';
   FS.DateSeparator  := '.';
   if not TryStrToDate(MaskDoFormatText('##\.##\.##',edtDatum.Text, ' '), Datum, FS) then
      ShowMessage('Falsch');


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:23 Uhr.
Seite 2 von 2     12   

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