Home › Forums › Front-end Issues › ACF Date Picker (date output) › Reply To: ACF Date Picker (date output)
You’re not using the correct piece of code. If you want to use date_i18n, you have to set the language of your WordPress to English. This is a WP specific function.
To use the setlocale method, use this code inside the loop (the setlocale on top is OK):
// FIRST, SET THE WAY YOU WANT TO FORMAT DATE
// DETAILS HERE - https://php.net/strftime
$dateformatstring = "%A le %d %B, %Y";
// THEN, CONVERT THE FIELD FROM ACF TO UNIX TIMESTAMP
$unixtimestamp = strtotime(get_field('data_picker'));
// NOW ECHO THE ENGLISH DATE USING PHP'S strftime
echo strftime($dateformatstring, $unixtimestamp);
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.