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
860 stars 110 forks source link

Problem with 'forge' #49

Closed sajaddp closed 5 years ago

sajaddp commented 5 years ago

Hi, On version 3, when i using Jalalian::forge(1538902714) i got below error: DateTime::__construct(): Failed to parse time string (1538902714) at position 8 (1): Unexpected character

Can you help me?

morilog commented 5 years ago

It's a bug and i will fix it as soon as possible. temporary solution: Jalalian::forge(date('Y-m-d H:i:s', 1538902714))

iBelit commented 5 years ago

just add this in forge function and createfromCarbon function: if(check if is int) { $time = \Carbon\Carbon::createFromTimestamp($time); }