![]() |
AW: Datum wird nach "FormatDateTime" falsch ausgegeben
Zitat:
Zitat:
|
AW: Datum wird nach "FormatDateTime" falsch ausgegeben
Noch einmal hallo zusammen.
Wunschgemäß führe ich hier einmal meine Funktion auf, mit der ich das Datum nun umstelle:
Delphi-Quellcode:
Sicherlich geht es noch kürzer, ich habe mir jedoch gedacht, lieber etwas ausführlicher schreiben um es auch später irgendwann mal wieder nachvollziehen zu können.
function ISODate(DateEU: String): String;
var datum_heute : Integer; ISO_jahr : String; EU_tag : String; EU_monat : String; EU_jahr : Integer; ISODatum : String; begin datum_heute := CurrentYear; EU_tag := FormatDateTime('dd', StrToDateTime(DateEU)); EU_monat := FormatDateTime('mm', StrToDateTime(DateEU)); EU_jahr := StrToInt(FormatDateTime('yyyy', StrToDateTime(DateEU))); if EU_jahr > datum_heute then EU_jahr := EU_jahr -100; ISO_jahr := IntToStr(EU_jahr); ISODatum := ISO_jahr + '-' + EU_monat + '-' + EU_tag; ISODate := ISODatum; end; Ich bedanke mich noch einmal für die entgegengebrachte Hilfe und wünsche allen ein schönes Wochenende. LG Micha |
AW: Datum wird nach "FormatDateTime" falsch ausgegeben
So wär's vielleicht besser:
Delphi-Quellcode:
function IsoDate(const DateEU : string) : TDateTime;
var LFs : TFormatSettings; begin LFs := TFormatSettings.Create; LFs.TwoDigitYearCenturyWindow := 99; Result := StrToDateTime(DateEU, LFs); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:57 Uhr. |
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