Req #61366 [Com]: DateInterval should support weeks and days combined

From: Date: Wed, 14 Mar 2012 01:51:40 +0000
Subject: Req #61366 [Com]: DateInterval should support weeks and days combined
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-168434@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61366&edit=1 ID: 61366 Comment by: uramihsayibok at gmail dot com Reported by: evert at rooftopsolutions dot nl Summary: DateInterval should support weeks and days combined Status: Open Type: Feature/Change Request Package: Date/time related Operating System: Any PHP Version: 5.3.10 Block user comment: N Private report: N New Comment: ISO 8601 doesn't allow mixing weeks with anything else. If you need both then just do the math: 7 * weeks + days Previous Comments: ------------------------------------------------------------------------ [2012-03-12 21:53:19] evert at rooftopsolutions dot nl Description: ------------ The DateInterval should support specifying weeks and days at the same time. This is documented to not be supported, but this is imho silly and confusing. Test script: --------------- <?php $di = new DateIterval('P1W1D'); echo $di->d; ?> Expected result: ---------------- 8 Actual result: -------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61366&edit=1

« previous php.bugs (#168434) next »