note 95460 added to function.date
| From: | Anonymous at osu1 dot php dot net | Date: | Mon, 04 Jan 2010 15:45:49 +0000 |
| Subject: | note 95460 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164608@lists.php.net to get a copy of this message | ||
Although it is described in the documentation it took me some time to note that instead of:
<?php
date('Y-W');
?>
You'd better use:
<?php
date('o-W');
?>
to get the year and ISO-8601 weeknumber, since "o" automagically calculates the correct
year if the ISO week number (W) belongs to the previous or next year.
----
Server IP: 83.137.20.135
Probable Submitter: 84.245.2.253
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/95460
Del: integrated -- https://master.php.net/note/delete/95460/integrated
Del: useless -- https://master.php.net/note/delete/95460/useless
Del: bad code -- https://master.php.net/note/delete/95460/bad+code
Del: spam -- https://master.php.net/note/delete/95460/spam
Del: non-english -- https://master.php.net/note/delete/95460/non-english
Del: in docs -- https://master.php.net/note/delete/95460/in+docs
Del: other reasons-- https://master.php.net/note/delete/95460
Reject -- https://master.php.net/note/reject/95460
Search -- https://master.php.net/manage/user-notes.php