|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.10 OS: winXP
Private report: No CVE-ID:
 [2005-06-23 12:59 UTC] mehran20 at hotmail dot com
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-23 13:33 UTC]
I'll take a look at it, but it's a feature request, not a bug.
 [2005-06-30 23:40 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 01:01:30 2015 UTC