morilog / jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in php appliations, based on Jalali (Shamsi) DateTime class.
MIT License
856 stars 111 forks source link

ساپورت نشدن سال های بیشتر از 1416 #127

Closed alihastam closed 2 years ago

alihastam commented 3 years ago

در این پکیج سال های بیشتر از 1416 مثلا 1417 برای تبدیل به سال میلادی ساپورت نمیشه 2021-05-05_171642

خروجی : 1970-01-01

amirhs712 commented 2 years ago

Hey, this problem also occurred to me when I was using an old version of PHP 7.2 on windows (xampp).

I'm not sure if this problem is caused by the package itself, however changing my PHP installation fixed the issue for me. I ran your code with PHP 8.0.13 on Ubuntu with a Laravel 8, the result was "2039-01-01".

morilog commented 2 years ago

I write a test case to prove it. It supports your described use case

https://github.com/morilog/jalali/commit/1b0d8f0e25dca6da6c37b6f37c2b1f816f145f1b