Doc #79858 [NEW]: IntlDateTimeFormatter spec does not match PHP
| From: | m dot smeets at performation dot com | Date: | Tue, 14 Jul 2020 13:46:59 +0000 |
| Subject: | Doc #79858 [NEW]: IntlDateTimeFormatter spec does not match PHP | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-17707@lists.php.net to get a copy of this message | ||
From: m dot smeets at performation dot com
Operating system: Linux
PHP version: 7.3.20
Package: Date/time related
Bug Type: Documentation Problem
Bug description:IntlDateTimeFormatter spec does not match PHP
Description:
------------
---
From manual page: https://php.net/class.intldateformatter
---
According to https://www.php.net/manual/en/function.date.php
'Y' is "A
full numeric representation of a year, 4 digits" and 'o' is "ISO-8601
week-numbering year. 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)"
But in IntlDateFormatter "Y" is "Week of Year", shown in
http://userguide.icu-project.org/formatparse/datetime.
This means that
the following format will be interpreted differently
Test script:
---------------
date = 2018-12-31
format = d-m-Y
PHP date_format "31-12-2019"
IntlDate format "31-12-2020"
Expected result:
----------------
Expected result is the same, but I expect a warning on the PHP
IntlDateFormatter page:
https://www.php.net/manual/en/class.intldateformatter.php
--
Edit bug report at https://bugs.php.net/bug.php?id=79858&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79858&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79858&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79858&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79858&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79858&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79858&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79858&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79858&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79858&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79858&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79858&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79858&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79858&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79858&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79858&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79858&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79858&r=mysqlcfg