Bluehost.com Web Hosting $6.95

A Tricky Time Calculation

This is a discussion on A Tricky Time Calculation within the PHP General forums, part of the PHP Programming Forums category; Hi, Given the time range: 09:15 - 17:30 how can I tell how many 15 minute intervals occur between ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-23-2003
Shaun
 
Posts: n/a
Default A Tricky Time Calculation

Hi,

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...

Thanks for your help
Reply With Quote
  #2 (permalink)  
Old 11-23-2003
Eugene Lee
 
Posts: n/a
Default Re: [PHP] A Tricky Time Calculation

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);
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0