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

Issue on Time output #36

Closed sobhanatar closed 6 years ago

sobhanatar commented 6 years ago

Hi Thanks for such a nice library. I was previously using this library on L5.4 and everything was fine. Recently I switched to L5.5 and there is some weird thing happen.

When I insert my data in database I have the correct time(ex: 2017-10-25 10:35:34). I made a getAttributeStartDateTime($value) and getAttributeEndDateTime($value) and use below functions alternatively to get the date and time in jalali format:

return jDateTime::strftime('Y-m-d  H:m:s', strtotime($value), 'Asia/Tehran');
return jdate(strtotime($value))->format('Y-m-d H:m:s');

I changed all possible formats and the result is always the same. whatever I put in database the result of this function is XX:08:00.

By this I mean if I have 09:34:45 or 23:15:24 in database the result will be 09:08:00 and 23:08:00 accordingly.

I would appreciate if you help me on this matter

morilog commented 6 years ago

Problem is in your datetime formats m: Month number i : minutes

at first line, your format has one extra space too. fix these problems an try again

sobhanatar commented 6 years ago

Thanks morilog again I should have understanded it from fix 08 in all time parts