PHP :: Request #33452 :: date('Y-W', strtotime('2005-1-1')) returns '2005-53'
| Request #33452 | date('Y-W', strtotime('2005-1-1')) returns '2005-53' | ||||
|---|---|---|---|---|---|
| Submitted: | 2005-06-23 12:59 UTC | Modified: | 2005-06-30 23:40 UTC | ||
| From: | mehran20 at hotmail dot com | Assigned: | derick (profile) | ||
| Status: | Closed | Package: | Feature/Change Request | ||
| PHP Version: | 4.3.10 | OS: | winXP | ||
| Private report: | No | CVE-ID: | None | ||
[2005-06-23 12:59 UTC] mehran20 at hotmail dot com
Description:
------------
Well I've seen so many bugs reported in this discussion, but not exactly this one. The fact is, it's not a bug, more like a defect.
Date function lacks a format to return the year when used with 'W'. For example mySQL has '%X' for function date_format.
Reproduce code:
---------------
date('Y-W', strtotime('2005-1-1'))
Expected result:
----------------
2004-53
Actual result:
--------------
2005-53
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-06-23 13:33 UTC] derick@php.net
[2005-06-30 23:40 UTC] derick@php.net