php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5716 date("z")
Submitted: 2000-07-21 02:03 UTC Modified: 2000-07-21 08:05 UTC
From: eldorado at ticino dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1pl2 OS: Linux
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: eldorado at ticino dot com
New email:
PHP Version: OS:

 

 [2000-07-21 02:03 UTC] eldorado at ticino dot com
I've found an error when I ask the day of the year with
date("z") and gmdate("z")

The 1.Januar should be the number 1 but this function return number 0.

You can check it running this:

<?
for ($i=1; $i<=366; $i++){
echo date("d.m.Y  z",mktime(0,0,0,1,$i,2000));
echo "<br>";
}
?>

Please inform me if is not an error.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-21 08:04 UTC] hholzgra at cvs dot php dot net
this behaves like the c function mktime() it is built upon
and is documented as such:

see http://php.net/manual/function.date.php:
   z - day of the year; i.e. "0" to "365" 

where a normal year has [0..364] and a leap year [0..366]
 [2000-07-21 08:05 UTC] hholzgra at cvs dot php dot net
... and could someone please move the
status select somewhere near the
commit button ? ...

forgot to close, now  did
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC