Edit report at https://bugs.php.net/bug.php?id=62476&edit=1
ID: 62476 Comment by: Sjon at hortensius dot net Reported by: kaido at tradenet dot ee Summary: DateTime::createFromFormat z format incorrect wrt 29.02 Status: Open Type: Bug Package: Calendar related Operating System: debian 2.6.32-5-amd64 PHP Version: 5.4.4 Block user comment: N Private report: N New Comment: I can confirm this, this is broken since 5.3.9 http://3v4l.org/1Z4W4 Previous Comments: ------------------------------------------------------------------------ [2012-07-04 00:20:58] kaido at tradenet dot ee Description: ------------ When creating DateTime object from string and using z (day of year) format option, the 29.02 of the leap year is missing. works ok in 5.3.5 Test script: --------------- for ($d=55;$d<65;$d++) { $dt = DateTime::createFromFormat ('z.Y', $d.'.2012'); $dd = $dt->format ('d.m.Y'); echo "$d $dd\n"; } 29.02.2012 is clearly missing .. Expected result: ---------------- 55 25.02.2012 56 26.02.2012 57 27.02.2012 58 28.02.2012 59 29.02.2012 60 01.03.2012 61 02.03.2012 62 03.03.2012 63 04.03.2012 64 05.03.2012 Actual result: -------------- 55 25.02.2012 56 26.02.2012 57 27.02.2012 58 28.02.2012 59 01.03.2012 60 02.03.2012 61 03.03.2012 62 04.03.2012 63 05.03.2012 64 06.03.2012 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62476&edit=1