Hi
I am trying to count down to a particular future date. For example, today is August 30, 2016 at 17:00, my future date is October 1, 2016 at 15:00
I want to do a timer with a countdown every second of how many days, hours, minutes and seconds from today i.e. August 30, 29016 until October 1, 2016
This is what I have done currently.
and the output is...
Surely this is incorrect. It cant be 20 days as September has 30 days in itself and hours cant be 17 because thats the current time. I have done this on the timer..
Can someone please advise me? Thanks...
I am trying to count down to a particular future date. For example, today is August 30, 2016 at 17:00, my future date is October 1, 2016 at 15:00
I want to do a timer with a countdown every second of how many days, hours, minutes and seconds from today i.e. August 30, 29016 until October 1, 2016
This is what I have done currently.
B4X:
Dim speriod as period
speriod = DateUtils.PeriodBetween(sdatetimeEnd,DateTime.now)
log(speriod)
and the output is...
B4X:
[Days=20, Hours=17, IsInitialized=true
, Minutes=25, Months=7, Seconds=10
, Years=0]
Surely this is incorrect. It cant be 20 days as September has 30 days in itself and hours cant be 17 because thats the current time. I have done this on the timer..
B4X:
shh = speriod.Hours
smm = speriod.Minutes
smi = speriod.Seconds
sdy = speriod.Days
smi = 60 - smi
smm = 60 - smm
shh = 24 - shh
Can someone please advise me? Thanks...