Home › Forums › Backend Issues (wp-admin) › ACF Date Picker — Format › Reply To: ACF Date Picker — Format
Hey mckenna,
Yes, I’ve had finally found the same solution. It seems that this is the only way to make it works. Thanks for your reply !
My piece of code :
<?php
// get the publishing date
if ( $date = get_field('publishing-date') ) {
$dateTime = DateTime::createFromFormat("Ymd", $date);
if ( is_object($dateTime) ) {
setlocale(LC_TIME, 'fr_FR' );
$date = $dateTime->format('j F Y');
$year = strftime('%Y', strtotime($date));
$month = strftime('%m', strtotime($date));
$day = strftime('%d', strtotime($date));
$date = strftime('%e %B %Y', strtotime($date));
}
} ?>
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.