Simple Math Calculation Problem....
| From: | Scott Fletcher | Date: | Fri, 01 Aug 2003 14:18:15 +0000 |
| Subject: | Simple Math Calculation Problem.... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157941@lists.php.net to get a copy of this message | ||
Hi!
I'm a little stuck with this simple math problem. I'm trying to get a
number of days in integer, not float.
--snip--
$input_date = "12/16/2002";
$UserInput = explode("/", $input_date);
$UserInputMonth = $UserInput[0];
$UserInputDay = $UserInput[1];
$UserInputYear = $UserInput[2];
$clockDate = mktime(0,0,0,date("m"),date("d"),date("Y"));
$inputDate = mktime(0,0,0,$UserInputMonth,$UserInputDay,$UserInputYear);
$Days = (($clockDate - $inputDate) / (24 * 3600));
//$Days = round(Days);
--snip--
But then I get the idea of doing the round function but it only return a
'0' value. Anyone know?