php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75990 Wrong date convert in persian calendar
Submitted: 2018-02-21 13:50 UTC Modified: 2018-02-21 19:21 UTC
From: mhd dot jalilvand at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 5.6.33 OS: linux centos
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: mhd dot jalilvand at gmail dot com
New email:
PHP Version: OS:

 

 [2018-02-21 13:50 UTC] mhd dot jalilvand at gmail dot com
Description:
------------
I have tested in many environment and versions and i got same bug in all.


Test script:
---------------
$time1 = strtotime('2017-3-18');
$time2 = strtotime('2017-3-19');
$formater = new \IntlDateFormatter('en_US' . '@calendar=persian' ,
					\IntlDateFormatter::FULL,  \IntlDateFormatter::FULL, 'Asia/Tehran',
					\IntlDateFormatter::TRADITIONAL, 'Y-M-d');
echo $formater->format($time1);
// return correct Persian date:1395-12-28

echo $formater->format($time2);
// returns wrong Persian date:1396-12-29 Its year in increased by 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-21 19:21 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2018-02-21 19:21 UTC] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Y means the year of "week of the year" – you'll want to use the
lowercase y, see <https://3v4l.org/L3iie>.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 13:01:30 2020 UTC