[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-bugs
Subject:    [DOC-BUGS] Doc #79858 [Com]: IntlDateTimeFormatter spec does not match PHP
From:       "a at b dot c dot de" <php-bugs () lists ! php ! net>
Date:       2020-07-20 1:40:27
Message-ID: E1jxKn5-0004ba-F1 () bugs ! php ! net
[Download RAW message or body]

Edit report at https://bugs.php.net/bug.php?id=79858&edit=1

 ID:                 79858
 Comment by:         a at b dot c dot de
 Reported by:        m dot smeets at performation dot com
 Summary:            IntlDateTimeFormatter spec does not match PHP
 Status:             Open
 Type:               Documentation Problem
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        7.3.20
 Block user comment: N
 Private report:     N

 New Comment:

The documentation for the IntlDateFormatter constructor does say:

" pattern

    Optional pattern to use when formatting or parsing. Possible patterns are \
documented at  » http://userguide.icu-project.org/formatparse/datetime. "


Previous Comments:
------------------------------------------------------------------------
[2020-07-14 13:46:58] m dot smeets at performation dot com

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 this bug report at https://bugs.php.net/bug.php?id=79858&edit=1

-- 
PHP Documentation Bugs Mailing List (https://www.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic