Find the gross wall-clock interval between two HH:MM values, treating an equal or earlier end as the next day.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Both clock readings become minutes since midnight; a zero or negative difference receives 1,440 minutes before quotient and remainder yield hours and minutes. Decimal hours round that same minute total to two places.
Start time: 22:00 End time: 06:00
Hours: 8 Minutes: 0 Total minutes: 480 Total hours decimal: 8 Duration: 8h 0m
Night shifts use gross clock spans, same-zone overnight travel gets a rough duration, and room bookings compare times less than one day apart.