web analytics

Recurrence dates using PHP

PHP makes easy to generate recurrence dates using “strtotime”.It is awesome function supported by PHP.
The following samples are showing that . It is very easy to get real life recurrence dates like OUTLOOK.

 


echo date('Y-m-d',strtotime("now"));
echo date('Y-m-d',strtotime("10 September 2000"));
echo date('Y-m-d',strtotime("+1 day"));
echo date('Y-m-d',strtotime("+1 week"));
echo date('Y-m-d',strtotime("+1 week 2 days 4 hours 2 seconds"));
echo date('Y-m-d',strtotime("next Thursday") );
echo date('Y-m-d',strtotime("last Monday") );
echo date('Y-m-d',strtotime("last Monday of 2013-12") );
echo date('Y-m-d',strtotime("first Monday of 2013-12") );
echo date('Y-m-d',strtotime("second Monday of 2013-12") );
echo date('Y-m-d',strtotime("third Monday of 2013-12") );

I am implementing a class which will be easy to use.

 

 

 

Bivash Kanti Pal

Hi guys, This is the place where developers are sharing there thoughts....

Leave a Reply

Your email address will not be published. Required fields are marked *

Result of *Captcha loading...

Do NOT follow this link or you will be banned from the site!