Re: HELP!!! Date time problems!!!!
| From: | Pierre-Yves Lemaire | Date: | Thu, 08 Mar 2001 14:57:27 +0000 |
| Subject: | Re: HELP!!! Date time problems!!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43069@lists.php.net to get a copy of this message | ||
Hello,
this is a function I use on my site, you can problably find
your answer,
py
// =====================================================
// This function returns the difference between a dates
// and the current date.
// arg1: separator
// arg2: startdate date dd mm yyyy
// return number of days of differences
// ======================================================
function diff_date( $sep, $startdate ){
// Date of file in database
$startdate = explode( "$sep", $startdate );
$startdate = mktime( 0, 0, 0, $startdate[1], $startdate[2],
$startdate[0] );
// Now
$enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") );
// get difference in days by dividing by 24*24*60
return ( $enddate - $startdate ) / ( 86400 );
} // end function
----- Original Message -----
From: Bruno Freire <bruno@fujinor.com.br>
To: <php-general@lists.php.net>
Sent: Thursday, March 08, 2001 7:05 PM
Subject: [PHP] HELP!!! Date time problems!!!!
> Hi, My name is Bruno, From Brazil.....
>
> Yes...it's me again...hehehe....
>
> Look...my problem is..
>
> I wanna make something like this:
>
> (10 november 2001) - (5 November 2001) = 5 days
>
> (10 november 2001) - (10 December 2001) = 30 days
>
> How can i do this????
>
>
> Thanks for any help!!!!
>
> Your friend, Bruno!!!! From !!!!!
>