Re: date
| From: | Pierre-Yves Lemaire | Date: | Sun, 11 Mar 2001 14:04:18 +0000 |
| Subject: | Re: date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43402@lists.php.net to get a copy of this message | ||
Hello,
This works when you have a separator of some sort, a space would work too.
The tricky part is that mktime works with mm dd yy format.
$start = "2001-01-01";
$end = "2001-03-12";
$start = explode( "-", $start );
$start = mktime( 0, 0, 0, $start[1], $start[2], $start[0] );
$end = explode( "-", $end );
$end = mktime( 0, 0, 0, $end[1], $end[2], $end[0] );
$diff = ( $end - $start ) / ( 86400 );
echo $diff;
py
----- Original Message -----
From: FredrikAT <ftakle@online.no>
To: <php-general@lists.php.net>
Sent: Sunday, March 11, 2001 6:31 PM
Subject: [PHP] date
> Hi!
>
> I have 2 dates...
> $start = "20010101";
> $end = "20010312";
>
> What is the easiest way of finding out how many days are between?
>
> Thanx!
>
>
> ---------------------------------
> Fredrik A. Takle
> fredrik@takle.net
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>