Home › Forums › General Issues › Format date/time › Reply To: Format date/time
Hi,
This is how you should use date_i18n with ACF:
$dateformatstring = "l d F, Y";
$unixtimestamp = strtotime(get_field('date_picker'));
echo date_i18n($dateformatstring, $unixtimestamp);
This depends on your blogs language setting. If you want to manually specify the locale in PHP, ignoring WordPress, you can do it like this:
setlocale(LC_ALL, 'fr_FR');
echo strftime("%A le %d %B, %Y");
//with day of the week = mercredi le 18 septembre, 2013
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.