Calculate Time Duration

Hi there,

You can view a project here that will calculate the difference between a given start time and the current time.

This project calculates the total minutes between the current time and the given start time.
This is done by calculating (difference in hours * 60) + (difference in minutes)
(Eg. if the event starts at 10.30 and it is currently 9.45, the total minutes = (1 * 60) + (-15) = 45)

If this is total number of minutes is 0, it says that the event is starting right now.
If this is greater than 0, it says that the event starts in X hours and Y minutes.
If it is less than 0, it says that you are late! The event started X hours and Y minutes ago.
(X = total minutes divided by 60, Y = remainder of total minutes divided by 60).

2 Likes