PHP - time minus time to minutes

php

Solution

Here you go:

( strtotime('12:45:00') - strtotime('11:00:00') ) / 60

`strtotime()` is a very useful function. It returns the Unix timestamp for a wide variety of times and dates. So, if you take the two timestamps, and subtract them, then you have the difference in seconds. Divide by 60 to get the minutes.

Problem

In php i have two times - 11:00:00 and 12:45:00. I want to get the difference between them in minutes, in this case 105 minutes. Whats the best way that can be done? Thank you!

Original source