Clock Time Calculations
A clock time is a moment in time typically formatted with a colon (hh:mm)
Adding or subtracting time from a clock time
now + 3 hours 15 minutes | 6:26 pm
9:45 am - 15 hours 10 minutes | Yesterday at 6:35 pm
16:00 + 3 hours 12 minutes | 7:12 pm
Finding the interval between two clock times
7:30 to 20:45 | 3 hours 15 min
4pm to 3am | 11 hours
Ambiguity when using the minus (-) operator with clock times
Sadly, the minus operator can be ambiguous when it comes to clock times.
Many of us use it to indicate a range of time from the first clock time to the second clock time (which is in the future):
5pm - 9pm
(5pm to 9pm)
But many of us also use it to express a subtraction of second clock time from the first clock time:
5pm - 3pm
(5pm minus 3pm)
Soulver does its best to try and interpret what you mean given the particular clock times you choose:
/// Get the amount of time between these two clock times today
5pm - 7pm | 2 hours
5pm - 2pm | 2 hours
// This is interpreted as 4 pm today back to 3am earlier this morning
4pm - 3am | 13 hours
/// This is interpreted as 3am earlier this morning to 4pm today
3am - 4pm | 13 hours
For the most predictable results, use the "to" operator as described in Finding the Interval between two clock times.
Last updated
Was this helpful?