You are here: Re: strtotime() pre-1970 ? « PHP Programming Language « IT news, forums, messages
Re: strtotime() pre-1970 ?

Posted by Markus Ernst on 09/26/06 10:29

Baron Samedi schrieb:
> if I code
>
> $birth = strtotime('1 April 1950');
>
> then $birth = -1, I guess that this is because time "began" on 1st Jan,
> 1970. (although I seem to remember a few good times before that).
>
> So, what's the easiest way to find out how many days old I am (exactly,
> please, not just taking 1 April 1970 and adding 20 *365, which does not
> account for leap years?)
>
> Thanks in advance.
>

Have a look at the safestrtotime() function suggested in the user
contributed notes in the PHP manual:
http://ch2.php.net/manual/de/function.strtotime.php#54564

HTH
Markus

 

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

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