note 81974 added to function.date
| From: | boyfilhote at yahoo dot com dot br | Date: | Fri, 21 Mar 2008 21:29:54 +0000 |
| Subject: | note 81974 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137311@lists.php.net to get a copy of this message | ||
Find out how many days a month has (including leap-years) in one single line command:
$numberOfDays = date("d", mktime(0, 0, 0, $month + 1, 0, $year));
This is possible because if you set the field "day" as ZERO in MKTIME, it will consider
the last day of month-1.
----
Server IP: 69.147.83.197
Probable Submitter: 201.88.85.127
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/81974
Del: integrated -- https://master.php.net/note/delete/81974/integrated
Del: useless -- https://master.php.net/note/delete/81974/useless
Del: bad code -- https://master.php.net/note/delete/81974/bad+code
Del: spam -- https://master.php.net/note/delete/81974/spam
Del: non-english -- https://master.php.net/note/delete/81974/non-english
Del: in docs -- https://master.php.net/note/delete/81974/in+docs
Del: other reasons-- https://master.php.net/note/delete/81974
Reject -- https://master.php.net/note/reject/81974
Search -- https://master.php.net/manage/user-notes.php