You are here: Re: date arithmetic « All PHP « IT news, forums, messages
Re: date arithmetic

Posted by larry on 12/06/06 04:30

Of course I thought it over and came up with better examples:

$mn = date("m");
$yr = date("Y");
$dy = date("d");

$numdays = date("t",mktime(0,0,0,$mn,1,$yr));
$nextmonth1 = date("m/d/Y",mktime(0,0,0,$mn,$dy+30,$yr));
$nextmonth2 = date("m/d/Y",mktime(0,0,0,$mn+1,$dy,$yr));

Mktime can take 0, negative and positive vlaues beyond the day and
month limits and interpret them; if you put $dy+240 it will calculate
the date 240 days in advance of the date, etc.

Check on the parameters of the date() function there is some goodies in
there on what it can output.

Larry

 

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

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