Sunday, May 21, 2017

How to solve Carbon diffForHumans() time mismatch?

I use Laravel 5.3

for news create duration in Lravel blade tempate i use

echo \Carbon\Carbon::createFromTimeStamp(strtotime($news->approved_at),'Asia/Dhaka')->diffForHumans()

but i get time mismatch.

suppose approved_at = 2017-05-21 23:33:29

after 5 minutes it show 5 minute ago but it show 4 hours ago. i can not find the problem please help.



via masum billah

Advertisement