Autor Beitrag
rokdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: Do 05.02.04 18:44 
Hallo,
ich habe folgendes problem: in einem tstringgrid beeinhaltet die erste splate ein datum, was jetzt als string vorliegt. ich möchte das ver gern als tdate haben. allerdings weiß ich nicht ob das datum korrekt da der benutzer ja auch buchstaben eingeben könnte! Wie macht man so etwas???


rokdd


Zuletzt bearbeitet von rokdd am Di 10.02.04 13:23, insgesamt 1-mal bearbeitet
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Do 05.02.04 19:00 
Das funktioniert (aber soweit ich weiß erst ab D6)

ausblenden Delphi-Quelltext
1:
2:
 if not TryStrToTime(deinstring, xyz{:TDateTime}then
  Ungueltig;


Falls es nicht funktioniert, hier die Metzgermethode:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 try
  xyz := StrToTime(deinstring);
 except
  Ungueltig;
 end;
rokdd Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: Do 05.02.04 19:13 
hallo,
danke erstmal! schaut schon gut aus!
bei der 1.methode kommt immer die fehlermeldung! icg glaube dass es immer falsch formatiert habe dd.mm.jj ? auch mit dd.mm.jjjj klappt es nicht?! wie ist es richtig?

rokdd
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Do 05.02.04 19:53 
Es müsste dd.mm.yyyy heissen...
rokdd Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: Do 05.02.04 20:36 
es müsste.... funktioniert aber nicht... neutze aber jetzt die letzte variante. danke!

rokdd