php.net |  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
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-03 18:24 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-09-03 18:24 UTC] rasmus@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC