I have a problem with sorting values on my table. I sorted these items by created_at column. Its all good but when the table receives an item on 12:01am to 12:59am, they always appear first in the lists. Im am using custom date format.
$date_time = @date('F j Y g:i a', strtotime(@date('F j Y g:i a')));
and has an output of "April 15 2018 2:07 am"
my created_at column is varchar and the reason for that is I'm using date_default_timezone_set(); because the web server store item in different timezone and ruins the datetime when the item was actually created, that is why i dont use timestamp.
one more thing is that i want these time rendered as posted 3 hours ago or yesterday whatever the case maybe.
Im using laravel 5.6 for this one.