At line 618 of formFields.inc, replace that datetime
case with this one for better handling of that type.
-----
case "datetime": // special type for
displaying timestamps
// initialise some values
$name = "";
if (isset($this->_attributes["name"]))
$name = $this->_attributes["name"];
$datetime = null;
$day = $month = $year = $hour = $min =
$sec = -1;
// see if a value exists and process
if ( isset($this->_attributes['value'])
&& $this->_attributes['value'] != ''
&& $this->_attributes['value'] !=
' '
&& '0000-00-00 00:00:00' !=
$this->_attributes['value'] )
{
// submitted
if ( !preg_match('/\s/',
$this->_attributes['value']) )
{
$datetime = explode('-',
$this->_attributes['value']);
if (count($datetime) > 1)
{
$year = $datetime[0];
$month = $datetime[1];
$day = $datetime[2];
$hour = $datetime[3];
$min = $datetime[4];
$sec = $datetime[5];
}
}
// from db
else
{
$datetime = explode(' ',
$this->_attributes['value']);
if (count($datetime) > 0) {
$date =
explode('-',$datetime[0]);
$time =
explode(':',$datetime[1]);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$hour = $time[0];
$min = $time[1];
$sec = $time[2];
}
}
}
// new
else
{
$year = date('Y');
$month = date('m');
$day = date('d');
$hour = date('H');
$min = date('i');
$sec = date('s');
}