Hi can anyone explain the code why this was not working. Is it work for 1 day?
I mean i added 2 posts yesterday and this code was working fine. But today I added new and this is not working.
<?php
eventDate = new DateTime(get_field(‘event_date’));
echo $eventDate->format(‘M’)
?>
and this is working fine how?
// get raw date
$date = get_field(‘event_date’, false, false);
// make date object
$date = new DateTime($date);
echo $date->format(‘M’);`