Transform 2023-05-15 22:28:38 to 15-05-2023 10:38:38pm

PHOTO EMBED

Mon May 15 2023 23:27:23 GMT+0000 (Coordinated Universal Time)

Saved by @eneki #php

// Parse the initial value using Carbon
$dateTime = Carbon::parse($dateTimeString);

// Format the date and time as desired
$formattedDateTime = $dateTime->format('d-m-Y h:i:sA');
content_copyCOPY