|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-06-14 12:18 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2016-06-14 12:18 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ The function DateTime::createFromFormat('z Y', "59 2016") return false values if there is a leap year. I can't check it with DateTime::createFromFormat('z', "59"), because the leap year is next year, maybe than it's ok - but I don't think so. This bug is reported earlier, but till now not fixed. Test script: --------------- $date = DateTime::createFromFormat('z Y', "58 2016"); echo $date->format('j. M. Y')."<br>"; // Result: 28. Feb. 2016 $date = DateTime::createFromFormat('z Y', "59 2016"); echo $date->format('j. M. Y')."<br>"; // Result: 1. Mar. 2016 $date = DateTime::createFromFormat('d m Y', "29 02 2016"); echo $date->format('j. M. Y')."<br>"; // Result: 29. Feb. 2016 $number = cal_days_in_month(CAL_GREGORIAN, 2, 2016); // 29 echo "$number"; Expected result: ---------------- 28. Feb. 2016 29. Feb. 2016 29. Feb. 2016 29