Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 8 Jahren, 2 Monaten
Letzter Beitrag:
vor 8 Jahren, 2 Monaten
Beteiligte Autoren:
Goof.pcs.crosspost, Mitchell

string to time function

Startbeitrag von Mitchell am 27.07.2009 09:51

is there any way to have a similar function with stringtodate for the time?
I am having this time in string variable

fromtime is string
fromtime = "10:20:01PM"

ftimevar is time
ftimevar = stringtotime(fromtime)

ftimeval is int

ftimeval = timetointeger(ftimevar)

can somebody help me please?

Antworten:

Re: String to time function

Mitchell a écrit :
> is there any way to have a similar function with stringtodate for the time?
> I am having this time in string variable
> fromtime is string
> fromtime = "10:20:01PM"
> ftimevar is time
> ftimevar = stringtotime(fromtime)
> ftimeval is int
> ftimeval = timetointeger(ftimevar)
> can somebody help me please?
>
try to use : StringToDuration
Or
fromtime is string
fromtime = "10:20:01PM"
ftimevar is time
ftimevar..Hour = val(fromtime [[1 to 2]])
ftimevar..Minute = val(fromtime [[4 to 5]])
ftimevar..Second = val(fromtime [[7 to 8]])
IF fromtime [[9 to 11]]="PM" THEN
ftimevar..hour +=12
END
ftimeval is int
ftimeval = timetointeger(ftimevar)

(each part of the time should be on two characters else you should look
at the ExtractString function, instead of using [[A to B]])

Bye
Goof
Message forwarded from pcsoft.us.windev

von Goof.pcs.crosspost - am 27.07.2009 11:01
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.