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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 22:01:36 2025 UTC