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.
" type="hidden" ...">
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.
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"]); }
Source: https://ru.stackoverflow.com/questions/491360/
All Articles