]
Subject: Re: [PHP] Subtracting two dates
?
$otherDate = 2003-11-15; // -mm-dd format
$otherDateStamp = strtotime($otherDate);// now a unix timestamp
$difference = time() - $otherDateStamp; // diff in seconds
?
Then you need to decide if you want to show days, or hours
:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 8:27 PM
To: Ben C.; [EMAIL PROTECTED]
Subject: Re: [PHP] Subtracting two dates
?
$otherDate = 2003-11-15; // -mm-dd format
$otherDateStamp = strtotime($otherDate);// now a unix timestamp
$difference = time
on 12/03/03 4:35 PM, Justin French ([EMAIL PROTECTED]) wrote:
if you want to round ALL decimals up, then you might have to create
something from scratch, but
Actually, there's a link to both ceil() and floor() on the round() page in
the manual.
Justin
--
PHP General Mailing List
On March 11, 2003 09:35 pm, Justin French wrote:
READ THE F***ING MANUAL!!!
http://php.net/round clearly shows you how to round to a whole
number.
if you want to round ALL decimals up, then you might have to create
something from scratch, but
ceiling and floor functions are part of nearly
There are a lot of artlicles on this but I need a simple solution. I need
to subtract two dates as follows:
$date = date(Y-m-d);
$date1 = 2003-03-03;
$differencedate = ($date - $date1);
echo $differencedate;
When I do this I get 0. Please help!
?
$otherDate = 2003-11-15; // -mm-dd format
$otherDateStamp = strtotime($otherDate);// now a unix timestamp
$difference = time() - $otherDateStamp; // diff in seconds
?
Then you need to decide if you want to show days, or hours, or years
difference...
I'll show you
Thanks, Justin. It works.
-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 8:27 PM
To: Ben C.; [EMAIL PROTECTED]
Subject: Re: [PHP] Subtracting two dates
?
$otherDate = 2003-11-15; // -mm-dd format
$otherDateStamp
on 11/03/03 5:04 PM, Ben C. ([EMAIL PROTECTED]) wrote:
Thanks, Justin. It works.
Of course it does :P
HTH
Justin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
8 matches
Mail list logo