It really Work !!!
Sorry, thath was my syntax error!
Thanks very much !!
Rosen Marinov
""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Sorry,
> > it doesn't work !!
>
> Why do you say that? I just tested it and it worked.
> It returned:
>
> Sorry,
> it doesn't work !!
Why do you say that? I just tested it and it worked.
It returned:
"115.31296296296"
"115" being the number of days
".31296296296" is the fraction of the day that is the
difference of hours between the two times.
mktime() and date( "U" ) return a unix timestamp
Sorry,
it doesn't work !!
Rosen Marinov
""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> > How can I calculate days between two dates ?
>
> This should work:
>
> $firstDate = mktime( 0, 0, 0, 1, 12, 2001 );
> $secondDate = date( "U" );
> Hi,
> How can I calculate days between two dates ?
This should work:
$firstDate = mktime( 0, 0, 0, 1, 12, 2001 );
$secondDate = date( "U" );
$daysInBetween = ( $secondDate - $firstDate ) / 86400;
Chris
4 matches
Mail list logo