Autor Beitrag
Hagbard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mo 07.06.04 15:20 
Hallo Delphi Freunde :-)

Ich habe evt. ein kleines Problem.

Ich möchte in einem Tool, welches in verschiedenen Ländern mit verschiedenen LänderSettings laufen wird ein Datum umwandeln:

In meiner Funktion bekomme Ich Tag, Monat und Jahr als String. Daraus müßte Ich ein DateTime machen.

Hat jemand eine Idee, wie das unabhängig der Ländersettings funktioniert???

Viele Grüße,
Christian

_________________
I haven't failed, I just found 10,000 ways that won't work!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 07.06.04 15:32 
Schau dir in der Hilfe mal Dateseparator und ShortDateFormat an. Damit legst du für dein Programm das Format des Datums fest.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
dateSeparator:='.';
shortdateformat:='DD/MM/YYYY';
// Damit sind z.B. 31.12.2004 und 1.1.04 gültige Datums-Strings.
// (Wenn ich mich nicht irre)

Edit: Ich geh mal davon aus, dass dir die Funktionen wie
StrtoDate('01.01.2004');schon über den Weg gelaufen sind...

_________________
We are, we were and will not be.
Hagbard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP Home / Pro
D7.1 Architekt
BeitragVerfasst: Mo 07.06.04 15:42 
Super Danke!!

Ja, StrtoDate('01.01.2004'); ist mir schonmal über den Weg gelaufen ;-)

Vielen Dank,
Christian

_________________
I haven't failed, I just found 10,000 ways that won't work!