Subtracting times?
| From: | Matthew Cothier | Date: | Sat, 23 Jun 2001 23:34:27 +0000 |
| Subject: | Subtracting times? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9781@lists.php.net to get a copy of this message | ||
I really need help here. What I am trying to do is the following.
-------------
$today = date("m.d.y");
$time = date("g:i a");
if($row[3] == $today){
if(($row[4] < $time) and ($time < $row[6])){
print("Now Showing");
} else {
print("Today at $row[4]");
}
} else {
print("$row[3] at $row[4]");
}
------------------------
$row[3] --> Date stored in database i.e 06.23.01
$row[4] --> Start time stored in database i.e 7.00 pm
$row[6] --> End time stored in database i.e 7.30 pm
My problem is that when it looks for the difference in time it works fine with say :
start time = 7:00 pm
end time = 8:00 pm
But as soon as I go into:
start time = 7:00 pm
end time = 7.35 pm
it mucks up!
Please help!! What do I need to do?
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.