From:             obibann at hotmail dot com
Operating system: RedHat EL 6.2
PHP version:      5.3.20
Package:          Date/time related
Bug Type:         Bug
Bug description:Wrong year on week calculation from 2012-12-30

Description:
------------
Set your server on December 30 2012:

date -s "20121230 11:00"

Ask PHP to give you the year and week 52 weeks ago thanks to the code
below.
PHP prints "201252" instead of "201201"
No problems from other dates of with another value of week.

Test script:
---------------
date_default_timezone_set("Your/Timezone"); // For me Europe/Paris
echo date("YW",strtotime("-52 week"));

Expected result:
----------------
201201

Actual result:
--------------
201252

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63970&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63970&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63970&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63970&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63970&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63970&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63970&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63970&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63970&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63970&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63970&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63970&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63970&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63970&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63970&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63970&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63970&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63970&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63970&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63970&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63970&r=mysqlcfg

Reply via email to