Trying to make a Sleep Tracker App

I'm trying to make a sleep tracker app as a project for school. I'm having trouble with the app not recognizing the next day when subtracting the time you sleep with the time you wake up at. This is what current blocks look like, and I would appreciate any help with it.

You can use the instant of two time picker, then get the duration of these 2 instants, then convert to hours, then check if it is bigger than 8 .

How do I do that? I'm just a beginner and don't know how app inventor fully works yet.

It doesn't seem to work for me. The result would end up as negative when I set the time to sleep as 22:00 and the wake-up time as 7:00 of the next day.

then how do you figue out the end up time is same day with start time or next day?

Is there a way to separate the days between the the two TimePickers?

if the end time is small, that means it's next day:

1 Like

It works! Thank you very much.

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