This project was inspired by a support request on my Facebook App Inventor Projects page.
It calculates the fractional number of days between two dates using two DatePickers and a Clock component.
returns a fractional day from two date inputs formatted as MM/DD/YYYY
Explanation:
Use the number of milliseconds between dates to calculate the number of days between the dates by using dimensional analysis to convert ms to days (ignores leap seconds):
ms x 1 sec x 1 hr 1 day
----- ---- x -----
1000 ms 3600 sec 24 hr
So: ms/86400000 = fractional days
![](https://lh5.googleusercontent.com/-C_5hzAuyCvg/VNia6hP2xVI/AAAAAAAAMrs/LJ5-xaysgZ0/s1600/output.PNG)
![](https://lh4.googleusercontent.com/-8OQusi8XZeQ/VNibAuSZ-tI/AAAAAAAAMr0/Cj-4eMJwAXE/s320/blocks.PNG)
aia project is attached.
See also this simple example of calculating days between dates for AI Classic > here <
It could be easily rewritten for the current AI version. Will you be the one to do it?
---
sf