Home › Forums › General Issues › Ninja Forms and ACF Date/Time Picker Not Behaving › Reply To: Ninja Forms and ACF Date/Time Picker Not Behaving
WP automatically serializes arrays when inserted into the DB, so you need to know if it’s an array or it’s already serialized. I’m guessing that it’s an array because if not I would expect to see a double serialization, however, that does not always happen and is no guarantee.
// if the value is serialized do this
$date = unserialize($date);
// always do this
$date = $date['date'].' '.$date['hour'].':'.$date['minute'].$date['ampm'];
$date = date('Y-m-d H:i:s', 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.