php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63190 IntlDateFormatter::format loose a year on 2012 Jan
Submitted: 2012-09-30 09:44 UTC Modified: 2013-06-09 22:16 UTC
Votes:4
Avg. Score:4.0 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: dpmancus at gmail dot com Assigned: cataphract (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dpmancus at gmail dot com
New email:
PHP Version: OS:

 

 [2012-09-30 09:44 UTC] dpmancus at gmail dot com
Description:
------------
$a= \DateTime::createFromFormat('Y-m-d H:i:s', '2012-01-01 10:56:31');

$formatter = new IntlDateFormatter(
            'it',
            \IntlDateFormatter::FULL,
            \IntlDateFormatter::FULL,
            'Europe/Rome',
            \IntlDateFormatter::GREGORIAN,
            'd-MMMM-Y H:m:s'
        );

echo "\ndate: " . date('d-m-Y H:i:s', $a->getTimestamp()) . "\n";
echo "formatter: " . $formatter->format($a->getTimestamp()) . "\n\n";

Expected result:
----------------
date: 01-01-2012 11:55:38
formatter: 1-gennaio-2012 10:55:38


Actual result:
--------------
date: 01-01-2012 11:55:38
formatter: 1-gennaio-2011 10:55:38


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-30 09:51 UTC] dpmancus at gmail dot com
please do not worry about time, i've copied from terminal the result of the 
attempt with that time(10:55:38)
 [2012-10-04 03:35 UTC] laruence@php.net
-Assigned To: +Assigned To: cataphract
 [2013-06-09 22:16 UTC] cataphract@php.net
-Status: Assigned +Status: Not a bug
 [2013-06-09 22:16 UTC] cataphract@php.net
"Y" means year of "week of year" purposes. You mean "y". See the table on http://icu-project.org/apiref/icu4c/classicu_1_1SimpleDateFormat.html#details
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC