title: Yii framework Invalid datetime format on create
body: <p>I have such <code>projects</code> table structure</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `projects` (
    `project_id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `description` text NOT NULL,
    `url` varchar(255) NOT NULL,
    `create_time` datetime DEFAULT NULL,
    `create_user_id` int(11) DEFAULT NULL,
    `update_time` datetime DEFAULT NULL,
    `update_user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`project_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>when I try to create new record with next form</p>
  
  <p><img src="https://i.stack.imgur.com/ehHmo.jpg" alt="enter image description here"></p>
  
  <p>Rules in model:</p>
  
  <pre><code>public function rules()
      {
          // NOTE: you should only define rules for those attributes that
          // will receive user inputs.
          return array(
              array('title, description, url', 'required'),
              array('create_user_id, update_user_id', 'numerical', 'integerOnly'=&gt;true),
              array('title, url', 'length', 'max'=&gt;255),
              array('create_time, update_time', 'safe'),
              // The following rule is used by search().
              // Please remove those attributes that should not be searched.
              array('project_id, title, description, url, create_time, create_user_id, update_time, update_user_id', 'safe', 'on'=&gt;'search'),
          );
      }
  </code></pre>
  
  <p>I have received error</p>
  
  <blockquote>
    <p>CDbCommand failed to execute the SQL statement: SQLSTATE[22007]:
    Invalid datetime format: 1292 Incorrect datetime value: '' for column
    'create_time' at row 1. The SQL statement executed was: INSERT INTO
    <code>projects</code> (<code>title</code>, <code>description</code>, <code>url</code>, <code>create_time</code>,
    <code>create_user_id</code>, <code>update_time</code>, <code>update_user_id</code>) VALUES (:yp0, :yp1,
    :yp2, :yp3, :yp4, :yp5, :yp6)</p>
  </blockquote>
  
  <p>Why? How can I tell Yii that datetime fields are not required and can contain default value if not entered.</p>