|
Posted by Oli Filth on 11/11/05 21:10
el_roachmeister@yahoo.com said the following on 11/11/2005 18:56:
> thanks for the replies, here's what I did. Is there any situation where
> this would not give the right answer?
>
>
> function get_current_day() {
>
> $then = mktime ( 0 , 0, 0, 1,1,'00');
> $now = time();
>
> $days = ($now - $then ) / 86400 - 1;
>
> return (int) $days;
>
> } // end function
>
Not sure about the -1. If today was the 2nd Jan 2000, for instance, then
your answer would be 0, but you presumably would want 1.
--
Oli
Navigation:
[Reply to this message]
|