banner
Nov 17, 2013
6 Views
0 0

Recurrence dates using PHP

Written by
banner

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.

 

 

Share this:
Article Tags:
·
Article Categories:
PHP
banner

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

Leave a Comment

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

Result of *

Social Widgets powered by AB-WebLog.com.