Support

Account

Home Forums Front-end Issues How do the date of publication by a front-end form? Reply To: How do the date of publication by a front-end form?

  • Hi @buylov

    That’s weird. I tested it on my end last time and it’s working. Could you please explain to me what do you mean by “not work”? Does the date change to the selected date or use the current date?

    If you want to set the time manually, I think you can add two more dummy fields for the hours and minutes. After that, you can add it to $theDate variable like this:

    $theDate = get_field('post-date', $post_id, false);
    $theDate = $theDate . "|" . get_field('dummy_hour', $post_id, false);
    $theDate = $theDate . ":" . get_field('dummy_minute', $post_id, false);
    if($theDate){
        $theDate = date_create_from_format('Ymd|H:i', $theDate);

    I hope this helps.