PHP: Formatting Date Specified as YYYY-MM-DDT00:00:00
public function formatDate($date, $daysToAdd)
{
$dateTime = new DateTime($date);
// Change the format accordingly
$dateTimeFormatted = $dateTime->format('Y-m-d h:m:s');
return str_replace(' ', 'T', $dateTimeFormatted);
}
No comments:
Post a Comment