Re: Simple Math Calculation Problem....
| From: | Scott Fletcher | Date: | Fri, 01 Aug 2003 14:32:54 +0000 |
| Subject: | Re: Simple Math Calculation Problem.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157945@lists.php.net to get a copy of this message | ||
Gee! I forgot the '$'. It's been right there in my face. Thanks! I hope
the round() function work without a problem because I saw in some posting
that some people have this problem where if 3.51 is rounded, it return a 3.
"Seth - Kate Buntin" <seth.buntin@coe.murraystate.edu> wrote in message
news:531E49BCE4838C40930430FBCF8D2EBC2C1D0F@coeexchange.coe.murraystate.edu...
I used your snip you just posted and changed the $Days = round(Days) to
$Days = round($Days) and got 228.
-----Original Message-----
From: Scott Fletcher [mailto:scott@abcoa.com]
Sent: Friday, August 01, 2003 9:18 AM
To: php-general@lists.php.net
Subject: [PHP] Simple Math Calculation Problem....
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?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php