Hi – I wonder whether you ever solved this issue. I have the same error. I have diagnosed that this only happens if the day value is greater than 12. Obviously this is a format issue but on the Event edit screen it shows correctly. If I set the date to say 12 July everything is cool but my code returns the 7th December. If I change it to 13 July it falls over – as there is no 13th month.
My WP general setting is set to GMT
The relevant code is:
$eventDate = new DateTime(get_Field(‘event_date’));
<span class=”event-summary__day”><?php echo $eventDate->format(‘d’) ?>
Any help gratefully received
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!