Date field entering 0000-00-00 00:00:00

2

The date field of my application is entering the values 0000-00-00 00:00:00 , but I can not find the file that makes the insert,

The function that makes write to the bank is this:

$db = & JFactory::getDBO();
if ($db->connected()) {
   $data =new stdClass();
   $data->nome = $_POST['nome'];
   $data->email = $_POST['email'];
   $data->telefone = $_POST['telefone'];
   $data->cidade = $_POST['cidade'];
   $data->estado = $_POST['estado']; 
   $db->insertObject('database_orcamentos', $data);
    
asked by anonymous 16.10.2015 / 15:38

1 answer

2

You can force a value into this date field by creating a property with the same column name.

$data->estado = $_POST['estado'];
$data->created = date('Y-m-d H:i:s');
    
16.10.2015 / 15:54