Return to Snippet

Revision: 6016
at February 17, 2009 09:00 by stancell


Updated Code
Today: <?php echo date('Y-m-d') ?> <br />
Tomorrow: <?php echo date('Y-m-d', strtotime('+1 day')) ?> <br />
Yesterday: <?php echo date('Y-m-d', strtotime('-1 day')) ?> <br />
1 week later: <?php echo date('Y-m-d', strtotime('+1 week')) ?> <br />
1 month later: <?php echo date('Y-m-d', strtotime('+1 month')) ?> <br />

// relative date
1 day after <?php echo date('Y-m-d', strtotime('+1 day', strtotime($someDate))) ?> <br/>

Revision: 6015
at April 21, 2008 13:08 by stancell


Updated Code
Today: <?php echo date('Y-m-d') ?> <br />
Tomorrow: <?php echo date('Y-m-d', strtotime('+1 day')) ?> <br />
Yesterday: <?php echo date('Y-m-d', strtotime('-1 day')) ?> <br />
1 week later: <?php echo date('Y-m-d', strtotime('+1 week')) ?> <br />
1 month later: <?php echo date('Y-m-d', strtotime('+1 month')) ?> <br />

Revision: 6014
at April 21, 2008 12:44 by stancell


Initial Code
Today: <?php echo date('Y-m-d') ?> <br />
Tomorrow: <?php echo date('Y-m-d', strtotime('+1 day')) ?> <br />
1 week later: <?php echo date('Y-m-d', strtotime('+1 week')) ?> <br />
1 month later: <?php echo date('Y-m-d', strtotime('+1 month')) ?> <br />

Initial URL

                                

Initial Description
Today, tomorrow, yesterday and other date calculations

Initial Title
Sample date calculations

Initial Tags
date

Initial Language
PHP