The form data are being saved and returned as-is, and the poor mutate_content file tries to format the pub_date and unpub_date values as it is instructed to do...but the data it is being given are already formatted!
I’ve posted the bug and its fix in the bugtracker.
In the file mutate_content.dynamic.action.php, at line 133, replace these lines
// retain form values if template was changed
if($formRestored==true||isset($_REQUEST['newtemplate'])) {
$content = array_merge($content,$_POST);
$content["content"]=$_POST["ta"];
if(empty($content["pub_date"])) unset($content["pub_date"]);
if(empty($content["unpub_date"])) unset($content["unpub_date"]);
}
With this:
// retain form values if template was changed
// edited to convert pub_date and unpub_date
// sottwell 02-09-2006
if($formRestored==true||isset($_REQUEST['newtemplate'])) {
$content = array_merge($content,$_POST);
$content["content"]=$_POST["ta"];
if(empty($content["pub_date"])) {
unset($content["pub_date"]) ;
} else {
$pub_date = $content['pub_date'];
list($d, $m, $Y, $H, $M, $S) = sscanf($pub_date, "%2d-%2d-%4d %2d:%2d:%2d");
$pub_date = strtotime("$m/$d/$Y $H:$M:$S");
$content['pub_date'] = $pub_date;
}
if(empty($content["unpub_date"])) {
unset($content["unpub_date"]);
} else {
$unpub_date = $content['unpub_date'];
list($d, $m, $Y, $H, $M, $S) = sscanf($unpub_date, "%2d-%2d-%4d %2d:%2d:%2d");
$unpub_date = strtotime("$m/$d/$Y $H:$M:$S");
$content['unpub_date'] = $unpub_date;
}
}
This converts the human-readable date/times back to timestamps, and now the mutate_content script can happily convert the value it is given. Poor computers...they do exactly what we tell them to do (unlike our teenaged children), and then we malign them for not doing what we wanted them to do!