|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52770 Documentation for date() has wrong range for 'z'
Submitted: 2010-09-03 18:18 UTC Modified: 2010-09-03 22:00 UTC
From: guy dot paddock at redbottledesign dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
 [2010-09-03 18:18 UTC] guy dot paddock at redbottledesign dot com
The documentation for the date() function states that the format character 'z' will produce a value in the range 0 to 365.

Technically, this is incorrect -- since the format character 'z' is the day of the year starting from 0, the maximum value it can have is 364, not 365.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-03 18:24 UTC]
-Status: Open +Status: Bogus
 [2010-09-03 18:24 UTC]
Leap years have 366 days, so 0-365 is correct.
 [2010-09-03 21:32 UTC] niel dot archer at blueyonder dot co dot uk
You're forgetting leap years where it can have 365 days, hence the range 0 to 365.
 [2010-09-03 22:00 UTC] guy dot paddock at redbottledesign dot com
Ah... yes... leap years. Sorry about that.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 13:01:23 2021 UTC