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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guy dot paddock at redbottledesign dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 26 18:01:31 2024 UTC