Support

Account

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));