Skip to content

Instantly share code, notes, and snippets.

@mdsami
Last active May 19, 2023 09:02
Show Gist options
  • Save mdsami/ae7b3b3226e6f39df0c95698a03d743f to your computer and use it in GitHub Desktop.
Save mdsami/ae7b3b3226e6f39df0c95698a03d743f to your computer and use it in GitHub Desktop.
Laravel-carbon AM , PM Date formate in blade
// 24 Hrs formate
<td> {{ Carbon\Carbon::parse($item->created_at)->format('d-M-Y G:ia') }}</td>
//Output
//20-Jan-2019 00:17:16 AM
// 12 Hrs formate
<td> {{ Carbon\Carbon::parse($item->created_at)->format('d-M-Y g:i:s A' ) }}</td>
//Output
//20-Jan-2019 12:17:16 AM
@prondubuisi
Copy link

Thanks for the snippet, I think $item->created_at->format('d-M-Y g:i:s A' ) is sufficient though.

@mdsami
Copy link
Author

mdsami commented Feb 6, 2022

yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment