title: Yii2, how do I insert the current time into a date time field using yii/db/Migration?
body: <p>I'm using the Yii 2 framework and I am creating a migration file. In this migration I am trying to insert a record into a table using </p>
  
  <pre><code>$this-&gt;insert('table_name', ['column_name'=&gt; time]); 
  </code></pre>
  
  <p>The column name I'm trying to update without success is the <code>created_at</code> and <code>updated_at</code> fields that are currently the type of <code>datetime</code> with <code>null</code> set to <code>Yes</code>. I could just set the default attribute of the column to current timestamp. However I am not the one that created the database and am reluctant on modifying the table scheme. I have tried many different ways to set the datetime field to the current datetime with no luck. Attached are two screenshots of the current code I have and the current table scheme. </p>
  
  <p>Apologize in advance for the newb question. Any help would be greatly appreciated, please and thank you.  </p>
  
  <p><img src="https://i.stack.imgur.com/m8g9a.jpg" alt="yii/db/Migration code"></p>
  
  <p><img src="https://i.stack.imgur.com/ner28.jpg" alt="table"></p>