日期字段正在PHP和MySQL中重置

When I am trying to edit some fields in the form, the date is being reset to 01-01-1970 01:00:00 but its stores and retrieves its value from the database perfectly for the very first time. Then it's being reset when I edit some other fields except date.

Below my jQuery date picker:

<script>
$(document).ready(function(){
    $("#policy_start_date").datepicker({
        numberOfMonths: 1,
        onSelect: function(selected) {
            $("#policy_end_date").datepicker("option","minDate", selected)
        }
    });
    $("#policy_end_date").datepicker({ 
        numberOfMonths: 1,
        onSelect: function(selected) {
            $("#policy_start_date").datepicker("option","maxDate", selected)
        }
    });  
});
</script>

POST DATA

$date_t=$_POST['policy_start_date'];
$datearr=explode('/',$date_t);

$month=$datearr[0];
$day=$datearr[1];
$year=$datearr[2];
$policy_start_date=$year."-".$month."-".$day;
//$policy_end_date   = $_POST['policy_end_date'];
$date_t=$_POST['policy_end_date'];
$datearr=explode('/',$date_t);

$month=$datearr[0];
$day=$datearr[1];
$year=$datearr[2];
$policy_end_date=$year."-".$month."-".$day;

Usually this is happen because the format stored in db and the format sent/acceptable by datepicker.

Standard datepicker format is 09/03/2013 (m/d/y).

What is displayed on the textbox when you echoed the data? 1. 09/03/2013 (m/d/y) or 2. 2013-09-13 00:00:00 (Y-m-d H:i:s)

if option one (1) is displayed, then we certain need to see the code that display the form you used.

if option two(2) is displayed, then you need to format it before echoing into the textbox. use this,

$time = strtotime($date_stored_in_database);
$your_date = date('Y/m/d',$time);

The strtotime will convert the date you stored in database into UNIX TIMESTAMP, and date function will convert it to the format you needed.