Skip to first unread message

Carlos Andre

unread,
Apr 22, 2019, 12:44:40 PM4/22/19
to MIT App Inventor Forum
I need to calculate the difference between hours. Could you please help me with how to do this?
Example:
Time 1: 4/22/2019 1:40 PM
Time 2: 04/23/2019 08:40
Result: 19 hours or 1140 minutes

Thank you

TimAI2

unread,
Apr 22, 2019, 12:55:23 PM4/22/19
to MIT App Inventor Forum
Try the duration blocks or convert your date/times to milliseconds, do the calculation (84600000 milliseconds per day, 3600000 milliseconds per hour)

Chris Ward

unread,
Apr 22, 2019, 1:08:50 PM4/22/19
to MIT App Inventor Forum
Hi Carlos

There is an example code snippet on my website:
Reply all
Reply to author
Forward
0 new messages