Re: Count down date
Posted: Wed Jul 02, 2014 3:35 pm
That's right.
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Code: Select all
on mouseUp
--CURRENT TIME CONVERT TO SECONDS
put long system time into field "CURRENT"
put field "CURRENT" into ctime
set itemDel to colon
put item 1 of ctime into chours
put item 2 of ctime into cminutes
put item 3 of ctime into cseconds
--Multiply hours by 60 minutes
multiply chours by 60
--Multiply 60 minutes by 60 seconds
multiply chours by 60
--Multiply minutes by 60 seconds
multiply cminutes by 60
--ADD ALL:
add cseconds to chours
add cminutes to chours
--FINAL TIME CONVERT TO SECONDS
put field "FINAL" into ftime
set itemDel to colon
put item 1 of ftime into fhours
put item 2 of ftime into fminutes
put item 3 of ftime into fseconds
--Multiply hours by 60 seconds
multiply fhours by 60
--Multiply 60 minutes by 60 seconds
multiply fhours by 60
--Multiply minutes by 60 seconds
multiply fminutes by 60
--ADD ALL:
add fseconds to fhours
add fminutes to fhour
--SUBTRACT
subtract chours from fhours
put fhours into HH
divide HH by 3600
--To be continued...
end mouseUpBtw I've tried to convert seconds to HH:MM:SS in more simple way by thisNow simply display every second the remaining seconds (= rst) as HH:MM:SS
HH = rst div 3600
MM = (rst - HH*3600) div 60
SS = rst mod 60
Code: Select all
convert fhours to long system time