Req #15216 [Opn->Nab]: Number of weeks or parts thereof in a month
| From: | heiglandreas@php.net | Date: | Wed, 11 Jan 2017 06:37:41 +0000 |
| Subject: | Req #15216 [Opn->Nab]: Number of weeks or parts thereof in a month | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206500@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=15216&edit=1
ID: 15216
Updated by: heiglandreas@php.net
Reported by: ceo at l-i-e dot com
Summary: Number of weeks or parts thereof in a month
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Date/time related
Operating System: *
PHP Version: *
Block user comment: N
Private report: N
New Comment:
It almost has. With a bit of date-match you can calculate that like this:
$date = new DateTime('2017-02-01');
echo ceil(($date->format('t') + 6 - $date->format('w')) /7);
As it's something that can be done easily in userland there's no need to add further
complexity to the sources,
Previous Comments:
------------------------------------------------------------------------
[2002-01-24 23:41:58] ceo at l-i-e dot com
It would be Really Nifty (tm) if the date function had a
letter that meant:
number of weeks or partial weeks in a month
Then, a monthly-calendar system would know how many rows
you'll need...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=15216&edit=1