Re: A Tricky Time Calculation
| From: | Eugene Lee | Date: | Sun, 23 Nov 2003 21:42:35 +0000 |
| Subject: | Re: A Tricky Time Calculation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170734@lists.php.net to get a copy of this message | ||
On Sun, Nov 23, 2003 at 03:42:58PM -0000, Shaun wrote:
:
: Given the time range: 09:15 - 17:30 how can I tell how many 15 minute
: intervals occur between these two times? Obviously here I can work it out,
: but I need a calculation that will perform the maths for any two time
: ranges...
$time1 = '09:15';
$time2 = '17:30';
$intervals = floor((strtotime($time2) - strtotime($time1)) / 900);