Autor Beitrag
sintec
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Di 08.05.07 13:57 
Hallo leutz,

wie kann man prüfen ob in einem Editfeld eine reale Uhrzeit eingegeben wurde und wie ob das Format auch stummt (hh:mm)?
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 08.05.07 14:14 
Ich weiß das es einen Typ: TDate und TDateTime gibt. Es wird wohl auch ein TTime geben.
Beim TDateTime kann man das Format so bestimmen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
ShortDateFormat := 'MM-DD-YYYY'//oder
ShortDateFormat := 'YYYY-DD-MM'//oder
ShortDateFormat := 'MM.DD.YYYY'//oder
ShortDateFormat := 'YYYY.DD.MM';


Dazu muss man ggbnfalls den DateSeperator ändern.

ausblenden Delphi-Quelltext
1:
2:
DateSeparator := '-'//oder
DateSeparator := '.';


Ähnliches sollte somit auch mit der Uhrzeit gehen!
Ohne Gewähr natürlich :lol:

_________________
<(^^<) <(^^)> (>^^)>
===================


Zuletzt bearbeitet von FiceGoesDelphi am Di 08.05.07 14:23, insgesamt 1-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10184
Erhaltene Danke: 1259

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 08.05.07 14:19 
Moin!

TryStrToTime eingeben und F1 drücken. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 08.05.07 14:22 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  Zeit: Time;
begin
  ShortTimeFormat := 'hh:mm';
  TimeSeparator := ':';
  Zeit := TryStrToTime(Edit1.Text);
end;


So in der Art hätte ich es gemacht! Vllt hilft es dir ja!

_________________
<(^^<) <(^^)> (>^^)>
===================
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Di 08.05.07 14:30 
gibts nich sowas wie isValidDate() oder war das ne Funktion von mir :gruebel:

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 08.05.07 14:33 
user profile iconZeitGeist87 hat folgendes geschrieben:
gibts nich sowas wie isValidDate() oder war das ne Funktion von mir :gruebel:


Ich finde bei mir in Delphi nichts ... :roll:
War wohl eine deiner Funktionen!
Aber würde meins funktionieren? @ Stefan *gg*

_________________
<(^^<) <(^^)> (>^^)>
===================
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Di 08.05.07 14:37 
user profile iconFiceGoesDelphi hat folgendes geschrieben:
user profile iconZeitGeist87 hat folgendes geschrieben:
gibts nich sowas wie isValidDate() oder war das ne Funktion von mir :gruebel:


Ich finde bei mir in Delphi nichts ... :roll:
War wohl eine deiner Funktionen!
Aber würde meins funktionieren? @ Stefan *gg*


hmm weiß nich björn..ich denke mal der rückgabewert is n Boolean :)

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 08.05.07 14:39 
Wär doch auch zu schön gewesen, wenn ich mal was direkt auf anhieb richtig gemacht hätte ;)
Und langweilig für dich obendrein :lol:

_________________
<(^^<) <(^^)> (>^^)>
===================
sintec Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Do 10.05.07 10:03 
user profile iconFiceGoesDelphi hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  Zeit: Time;
begin
  ShortTimeFormat := 'hh:mm';
  TimeSeparator := ':';
  Zeit := TryStrToTime(Edit1.Text);
end;


So in der Art hätte ich es gemacht! Vllt hilft es dir ja!



Wo soll das eigentlich hin?
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Do 10.05.07 10:42 
da wo du das prüfen willst!
In ne Button Procedure oder so!

_________________
<(^^<) <(^^)> (>^^)>
===================
sintec Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Do 10.05.07 10:49 
Danke es funktioniert super!

Mal ne andere frage: Wie mach ich dass um eine bestimmte Uhrzeit eine Funktion ausgeführt wird?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10184
Erhaltene Danke: 1259

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 10.05.07 11:09 
Moin!

user profile iconsintec hat folgendes geschrieben:
Danke es funktioniert super!

Fein, markierst du den Thread dann noch entsprechend, wenn dein Problem gelöst ist? Danke. ;)

user profile iconsintec hat folgendes geschrieben:
Mal ne andere frage:

Andere Frage - anderer Thread! :mahn: Ist Forumsregel. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Do 10.05.07 11:19 
user profile iconZeitGeist87 hat folgendes geschrieben:
gibts nich sowas wie isValidDate() oder war das ne Funktion von mir :gruebel:


Müsste eine Funktion von dir sein. Es gibt standardmäßig bei Delphi die Funktion ScanDate, welches wahr oder falsch zurückgibt, aber diese Funktrion ist nicht öffentlich, sondern wird nur in SysUtils u.a. für TryStrToDate genutzt.