Start Time and End Time Result in decimal Form

Good day.

I need to perform the below calculation in both same day and if End Time is in next day:

Time in 12 hour format:
Current Time - Start Time (Time Picker) = decimal Result

Example Same Day:
7pm - 4:30pm = 2.5 Hours

Example Next Day:
1:15am 1/2/2022 - 4:30pm 1/1/2022 = 8.75 hours

Thank you.

Convert the date and time to Milli and do the rest

Do you want to achieve it using extension or without extension?

If extension mean multiple types are there and the one is

Without extension mean little more blocks to add

Thank you. I all really new to this.
I downloaded and imported the extension.

The part I am having the most issues is from the time picker. Not really sure how to get that time that is picked into millis.

The clock component from the sensor drawer does have several methods to work with date and time

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.


The time picker is not enough.
You need the date picker too, and the Clock component's blocks to build an Instant from them, then convert to milliseconds from the Instant for your calculations.

Thank you. I will try to figure that out as well.