There is a hidden field.

<input class="form-control" name="last_edit" value="<?php echo date("Ymd H:i:s")?>" type="hidden" > 

The problem is to enter this data into the database in timestamp format. Thank you in advance for your help.

    1 answer 1

    For example:

      //1. В контроллере получаете массив POST $post_arr = filter_input_array(INPUT_POST); if(isset($post_arr["last_edit"])) { //2. С помощью функции strtotime переводите "текстовую" дату в timestamp $last_edit_timestamp = strtotime($post_arr["last_edit"]); } 
    • The problem is not that after the translation by the strtotime function, the value is not written to the database, but that I need exactly the string representation (like 00:00:00) - DaVinchi
    • Hmm, do not really understand your clarification. Where do you need a string representation? Maybe you meant how to turn the timestamp value obtained from the database into a string of the form YYYY-MM-DD HH: MM: SS? - S. Pronin