Count down date
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Count down date
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:17 pm, edited 1 time in total.
shiftLock happens
Re: Count down date
Yea, go Germany!
I know how to make that kind of countdown, that's not problem, here is what I want: Current time is 18:28. My 'event' starts at 20:00. So the clock should start counting down like this: '01:31:50' until it gets to 00:00:00. I hope it's more clear now...
I know how to make that kind of countdown, that's not problem, here is what I want: Current time is 18:28. My 'event' starts at 20:00. So the clock should start counting down like this: '01:31:50' until it gets to 00:00:00. I hope it's more clear now...
Re: Count down date
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:17 pm, edited 1 time in total.
shiftLock happens
Re: Count down date
I tried already something like that, now it almost work... here is the code:
So I have done both current and final time conversion to seconds successfully, but I don't know how to write this simple mathematics in LiveCode (I need ALWAYS to write this with text?!)
but than I always get 1 spare hour...
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 mouseUp
Btw 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
Re: Count down date
..........
Last edited by [-hh] on Wed Aug 13, 2014 3:17 pm, edited 1 time in total.
shiftLock happens
Re: Count down date
Yep that works... Only I need to subtract 2 from hours and that corrects them (I have no idea why there is 2 spare hours)... Anyway finished, thank you all for help!