php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68102 Incorrect / misleading description of the ISO-8601 week-numbering year
Submitted: 2014-09-26 05:02 UTC Modified: 2016-07-25 15:36 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ryan dot y dot rhee at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2014-09-26 05:02 UTC] ryan dot y dot rhee at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.date
---

The explanation for the date format specifier `o` is as follows:

> ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)

That seems misleading. `o` is used as the _ISO week-numbering year_ which is different from the normal year that ISO-8601 uses. Unless one is using numbered weeks and day of the week to represent a date, the regular year is ISO-8601 compliant. However, calling this the "ISO-8601 year number" makes it seem like those who wish to conform to ISO-8601 should use `o`, which is incorrect.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-25 15:36 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339714
Log: Fix #68102: Incorrect / misleading description of the ISO-8601 week-numbering year
 [2016-07-25 15:36 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: Documentation problem +Package: Date/time related -Assigned To: +Assigned To: cmb
 [2016-07-25 15:36 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=5894f6e9704bd94daf5488c0ae6bee653eea7e1c
Log: Fix #68102: Incorrect / misleading description of the ISO-8601 week-numbering year
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC