I am new to WordPress and PHP and got stuck while using ACF.
I want to use a custom date field for my event section.
And on the front-end I only want to show the 3 letter of the month and nothing else but it won’t work. Please find below what I am writing in PHP.
$eventDate = new DateTime(get_field(‘event_date’));
the error I am getting is…
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (26/09/2019) at position 0 (2): Unexpected character in /app/public/wp-content/themes/fictional-university-theme/front-page.php:30
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!