Home › Forums › ACF PRO › Datepicker Problem › Reply To: Datepicker Problem
F.Y.I: Checking the post vars shows the right value to save:
acf[field_55b9e5d6b6561] = 19691123, that means 23. November 1969. So it is stored right into the database.
I tried two things:
$timestamp = strotime('19691123');
$birthdate = date_i18n( get_option( 'date_format' ), $timestamp );
which brings the wrong day: 22. November 1969
$timezone = new DateTimeZone(get_option('timezone_string'));
setlocale(LC_TIME, "de_DE.utf8");
$geburtsdatum = '19691123;
$geburtsdatum_dt = new DateTime($geburtsdatum , $timezone);
$birthdate = $geburtsdatum_dt->format(get_option( 'date_format' ));
which brings the correct date, but unfortunately in english language.
I of course can replace the month names in the strings, but that does not solve the root of the problem: The field in the backend is still showing the wrong date. Any thoughts on this? I am a bit in despair …
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.