note 63727 rejected from function.strtotime by bjori
| From: | bjori@php.net | Date: | Wed, 29 Mar 2006 11:25:24 +0000 |
| Subject: | note 63727 rejected from function.strtotime by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106938@lists.php.net to get a copy of this message | ||
Note Submitter: epilepticfridgeboy at hotmail dot com
----
A bit of silly strtotime behaviour here which might catch you out.
Assume the date today is March 29th 2006.
<?php
print date('Y-m-d', strtotime('-1 month'));
?>
will print '2006-03-01'.
strtotime says one -1 month from 2006-03-29 is 2006-02-29, which translates to 2006-03-01. Not one
month ago...