Clock Duration Problem - When time is less than 1 hour it adds 12 hours on

I have a timer count down app.
It works fine, except when you have a duration calculation and the result is less than 1 hour.
When it is less than one hour it adds 12 hours on to the duration.
7:25 am to 8:40 am = 1:15 (Correct)
7:25 am to 7:40 am = 12:15 (Error)
7:25 am to 8:40 pm = 1:15 (Error)
7:25 am to 7:40 pm = 12:15 (Correct)
I have tried changing to 24 clock and 12 hour clock.
Have tried using millis for instant and date format for instant.

AIA and blocks attached.
Can you see what I am missing? Thanks

countdown.aia (51.3 KB) countdownblocks|690x396

change this
You have done mistake while calculating the hour difference…
This will give exact hour difference between the current hour and time picker hour


Thank you for you suggestion. Does not work though.

But it is working fine for me. If i select the time less than 1hr it will show zero. If greater than an hour mean it will show the remaining hrs.

(pls see the Hour from now, you requested)


I did it in screen2 and not in screen3

1 Like

Please give me the TFormat .DurationHourMinSecFrom block aia file


Thanks, Is it work

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.