First parse the created_at field as Carbon object.
$createdAt = Carbon::parse($item['created_at']);
Then you can use
$suborder['payment_date'] = $createdAt->format('M d Y');
https://stackoverflow.com/questions/33405939/laravel-5-carbon-format-datetime
No comments:
Post a Comment