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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC