Re: Odd strtotime behavior
| From: | Jonas | Date: | Sat, 10 Jan 2004 15:41:10 +0000 |
| Subject: | Re: Odd strtotime behavior | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174204@lists.php.net to get a copy of this message | ||
Chris W wrote:
> The following code doesn't do what I expect and I was wondering if
> someone could tell me why and how to make it do what I want.
>
> $NowT = strtotime("January 9 2004");
> $EventT = strtotime("June 1 2004");
> print ($EventT - $NowT)/86400;
>
> I get 143.958333333
>
> Why don't I get 144?
>
> Chris W
Hi Chris,
try this:
$NowT = strtotime("January 9 2004");
$EventT = strtotime("June 1 2004");
print (round($EventT - $NowT)/86400);
greetings, Jonas