#25787 [Opn->Bgs]: 'yday' in getdate() function is out by one day
| From: | sniper@php.net | Date: | Wed, 08 Oct 2003 08:51:41 +0000 |
| Subject: | #25787 [Opn->Bgs]: 'yday' in getdate() function is out by one day | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48693@lists.php.net to get a copy of this message | ||
ID: 25787
Updated by: sniper@php.net
Reported By: australia at bookrealm dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: SuSE Linux 8.2
PHP Version: 4.3.1
New Comment:
Day count for this date (2003-10-08) is 280.
e.g.
# php -r 'echo date("z");'
280
It's propably mcal that is broken. (and I mean the library, not
extension)
Previous Comments:
------------------------------------------------------------------------
[2003-10-08 04:21:51] australia at bookrealm dot com
Description:
------------
The array key 'yday' from getdate() is one day less than it
should be. Bug can be confirmed using mcal_day_of_year().
Reproduce code:
---------------
<?php
$y = date(Y);
$m = date(n);
$d = date(j);
echo mcal_day_of_year($y,$m,$d) . "<br />";
$day_year = getdate();
echo $day_year[yday];
?>
Expected result:
----------------
Example date:
2003-10-8
Expected result:
281
281
Actual result:
--------------
Example date:
2003-10-8
Actual result:
281
280
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25787&edit=1