From:             australia at bookrealm dot com
Operating system: SuSE Linux 8.2
PHP version:      4.3.1
PHP Bug Type:     Date/time related
Bug description:  'yday' in getdate() function is out by one day

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 bug report at http://bugs.php.net/?id=25787&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25787&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25787&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25787&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25787&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25787&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25787&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25787&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25787&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25787&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25787&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25787&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25787&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25787&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25787&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25787&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25787&r=float

Reply via email to