You are here: Re: Add 1 Year to current date ? « PHP Programming Language « IT news, forums, messages
Re: Add 1 Year to current date ?

Posted by Justin Koivisto on 10/25/28 11:27

iuz wrote:

> Syl wrote:
>
>
>>I've been through the php.net docs, and this newsgroup - and all seems
>>to be configured properly, but this statement is still not working:
>>
>>switch ($level) {
>> case 1:
>> $nextyear = mktime(0,0,0,date("Y")+1,date("m"),date("d"));
>> $nextyear = strftime("%Y%m%d",$nextyear);
>> break;
>
>
> date('Y-m-d', 31536000) // this return the next year string (60*60*24*365)

What about on a leap year? ;) I tend to use strtotime for this kind of
thing since it is much easier to read some time down the road:

date('Y-m-d',strtotime('+1 year'));

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

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

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