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.
E.g.
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
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