I want to store php date in sql but it store 1970-01-01 05:00: instead of input datetime
This is html form
<input type="datetime" id="eventstart" name="txtEventStart" class="form-control" value="<?php echo date('m/Y/d h:i:s');?>">
when data is sent using post
$date = $this->input->post('txtEventStart');
I convert string to date format using:
$date2 = date('Y-m-d H:i:s', strtotime($date));
It stores '1970-01-01 05:00:00'
I want to know what is the correct format for storing such type of date.