Support

Account

Home Forums ACF PRO Migrating from timestamp to Date Field Reply To: Migrating from timestamp to Date Field

  • Using update field does not work for date (it works for string).
    So the solution I’ve put in place is :

    
    $this->birthdate = date( "Ymd", $this->birthdate );
    update_post_meta ($this->ID, 'birthdate',  $this->birthdate);
    update_post_meta ($this->ID, '_birthdate', 'field_53e11dd3841f6'); // CONSTANT KEY