|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75078 IntlDateFormatter displays wrong dates, off by a year (!)
Submitted: 2017-08-16 16:02 UTC Modified: 2017-08-16 17:44 UTC
From: f dot bosch at genkgo dot nl Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 7.2.0beta2 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 + 33 = ?
Subscribe to this entry?

 [2017-08-16 16:02 UTC] f dot bosch at genkgo dot nl
When formatting dates around the year ending IntlDateFormatter produces wrong outputs. Not just unexpected for the locale, but wrong values. More precisely: it is off by a year. This was already reported in #73405.

A. Formatting 2017-12-31 12:00:00. In this case en_US is wrong, off by a year.

Using: en_US, Europe/London, "Y".
- Result: 2018. Expected: 2017. 3v4l:

Using: en_US, Europe/London, "Y-MM-dd".
- Result: 2018-12-31. Expected: 2017-12-31. 3v4l:

Using: nl_NL, Europe/Amsterdam, "Y".
- Result: 2017. Expected: 2017. 3v4l:

Using: nl_NL, Europe/London, "Y".
- Result: 2017. Expected: 2017. 3v4l:

B. Formatting 2017-01-01 12:00:00. In this case nl_NL is wrong, off by a year.

Using: nl_NL, Europe/Amsterdam, "Y-MM-dd".
- Result: 2016-01-01. Expected: 2017-01-01. 3v4l:

Using: en_US, Europe/London, "Y-MM-dd".
- Result: 2017-01-01. Expected: 2017-01-01. 3v4l:

Test script:

$formatter = new IntlDateFormatter(

echo $formatter->format(
    new DateTime('2017-12-31 12:00:00', new DateTimeZone('Europe/London'))

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-16 17:28 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2017-08-16 17:28 UTC]
`Y` is supposed to show the year of "Week of Year". To get simply
the year, use 'y'. See also
 [2017-08-16 17:44 UTC] f dot bosch at genkgo dot nl
Damn, sorry guys. Please close!
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Mar 30 11:01:25 2020 UTC