note 91248 deleted from function.strtotime by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:04:34 +0000 |
| Subject: | note 91248 deleted from function.strtotime by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196797@lists.php.net to get a copy of this message | ||
Note Submitter: Merlin at silvercircle dot org
----
I've noticed that 'first monday' and '1 monday' are not treated equally.
To get the 1st of june 2009 when searching for the first monday:
Use 'first monday' and start from june 0:
<?php
$time= strtotime("first monday ", mktime(0, 0, 0, 06, 0, 2009));
echo "first monday " . date("d-m-Y", $time) . "<br />";
?>
Or use '1 monday' and start from june 1:
<?php
$time= strtotime("1 monday ", mktime(0, 0, 0, 06, 1, 2009));
echo "1 monday " . date("d-m-Y", $time) . "<br />";
?>
Took me a long time to figure this out.