You are here: Re: Number of days in 1/1/2000 « PHP Programming Language « IT news, forums, messages
Re: Number of days in 1/1/2000

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация