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 <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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   !!!!!
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to