figured out the logic,
but still cant make it run

i put this command :

echo diff_date("/", "05/03/2001") ;

to test the function. but it doest seem to work :(
any help ?

btw i believe it must be 24*60*60 inorder to 24*24*60 :)

""Pierre-Yves Lemaire"" <[EMAIL PROTECTED]> wrote in message
01c301c0a7e0$17f85f00$9ceee740@py">news:01c301c0a7e0$17f85f00$9ceee740@py...
> 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]
>



-- 
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