Autor Beitrag
Tarry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 213
Erhaltene Danke: 1



BeitragVerfasst: Mi 06.08.08 13:55 
Hi, ich hab (schon wieder) ein Problem...
Ich hab eine Zeit als String in dem Format 'nn:ss:zz' vorliegen...
Wie mache ich daraus wieder eine Zeit, die Delphi lesen / vergleichen kann ?
Mit StrToTime gibt's Probleme, wenn die Hundertstel über 60 hinauskommen, da er diese ja für die Sekunden hält....

Was kann man da machen ?
Ich suche im Grunde das Gegenteil von
ausblenden Delphi-Quelltext
1:
formatdatetime('nn:ss:zz', Now-StartTime);					


Gruß
Tarry

_________________
"Es gibt zwei Dinge, die unendlich sind. Das Universum und die menschliche Dummheit. Beim Universum bin ich mir noch nicht ganz sicher." -Albert Einstein
baka0815
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 489
Erhaltene Danke: 14

Win 10, Win 8, Debian GNU/Linux
Delphi 10.1 Berlin, Java, C#
BeitragVerfasst: Mi 06.08.08 14:14 
Was ist, wenn du StrToTime('00:' + myTimeStr); machst?
Dann setzt du ja die Std. davor (hier 0) oder klappt das nicht?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 06.08.08 14:19 
Verwende die überladene Variante und gebe das Format mit an

_________________
Markus Kinzler.
Tarry Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 213
Erhaltene Danke: 1



BeitragVerfasst: Mi 06.08.08 14:20 
user profile iconbaka0815 hat folgendes geschrieben:
Was ist, wenn du StrToTime('00:' + myTimeStr); machst?
Dann setzt du ja die Std. davor (hier 0) oder klappt das nicht?



Nein, ich habs ja in dem Format MM:SS:HH und er glaubt es wäre SS:MM:SS, deshalb bekommt der dann den Fehler, wenn der letzte Block über 60 liegt.

_________________
"Es gibt zwei Dinge, die unendlich sind. Das Universum und die menschliche Dummheit. Beim Universum bin ich mir noch nicht ganz sicher." -Albert Einstein
Tarry Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 213
Erhaltene Danke: 1



BeitragVerfasst: Mi 06.08.08 14:21 
user profile iconmkinzler hat folgendes geschrieben:
Verwende die überladene Variante und gebe das Format mit an


Wie soll das dann aussehen ? Meinst StrToTimeDef ? Damit hab ichs auch schon hinbekommen, aber i-wie auch nicht geschafft...

_________________
"Es gibt zwei Dinge, die unendlich sind. Das Universum und die menschliche Dummheit. Beim Universum bin ich mir noch nicht ganz sicher." -Albert Einstein
Hobby-Programmierer
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 238
Erhaltene Danke: 4

Win XP Pro, Vista Ultimate Trial :o)
D6 Pro, D7 Pro, Turbo, XE SE
BeitragVerfasst: Mi 06.08.08 17:43 
Hallo ...,
vielleicht hilft das hier. Musste nur anpassen.

LG Mario
Tarry Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 213
Erhaltene Danke: 1



BeitragVerfasst: Mi 06.08.08 21:03 
So, das Problem ist gelöst, danke euch allen ;)

_________________
"Es gibt zwei Dinge, die unendlich sind. Das Universum und die menschliche Dummheit. Beim Universum bin ich mir noch nicht ganz sicher." -Albert Einstein