note 106441 added to datetime.formats.relative
| From: | scragar at gmail dot com | Date: | Wed, 09 Nov 2011 16:04:06 +0000 |
| Subject: | note 106441 added to datetime.formats.relative | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184356@lists.php.net to get a copy of this message | ||
Just for those who want the last day of the year without calling the function twice:
<?php
echo date('Y-m-d',
strToTime('1/1 next year -1 day')
);
// 2011-12-31
?>
For reference this is actually saying "Take the first day of the first month next year, then
subtract 1 day".
----
Server IP: 192.41.42.26
Probable Submitter: 213.40.50.49
----
Manual Page -- http://www.php.net/manual/en/datetime.formats.relative.php
Edit -- https://master.php.net/note/edit/106441
Del: integrated -- https://master.php.net/note/delete/106441/integrated
Del: useless -- https://master.php.net/note/delete/106441/useless
Del: bad code -- https://master.php.net/note/delete/106441/bad+code
Del: spam -- https://master.php.net/note/delete/106441/spam
Del: non-english -- https://master.php.net/note/delete/106441/non-english
Del: in docs -- https://master.php.net/note/delete/106441/in+docs
Del: other reasons-- https://master.php.net/note/delete/106441
Reject -- https://master.php.net/note/reject/106441
Search -- https://master.php.net/manage/user-notes.php