convert MM:SS or HH:MM:SS to duration

imbault

Well-Known Member
Licensed User
Longtime User
Hi,

I'm using the Chronometer, and I've to convert the value which can be either MM:SS or HH:MM:SS to a duration, in minutes or seconds.

Maybe any of you, already, made that function...

BTW, I'll post tomorrow, the code to stop and restart later the chrono, it was not that obvious (code is at my work)

Cheers

Patrick
 

mc73

Well-Known Member
Licensed User
Longtime User
If you have the time in hh:mm:ss format, I think you can calculate seconds, as
B4X:
dim tm as string
tm="00:24:54"
dim sec as int
sec=3600*tm.substring2(0,2)+60*tm.substring2(3,5)+tm.substring(6)
 
Upvote 0
Top