title: Powershell writing to MySQL table column with datetime datatype
body: <p>I have a MySQL database I am using Powershell to update data in.  I can update to any text column but I'm having an issue with the 'time' columns that have a datatype of datetime.  According to the MySQL docs, datetime format is YYYY-MM-DD HH:MM:SS  (<a href="https://dev.mysql.com/doc/refman/5.1/en/datetime.html" rel="nofollow">https://dev.mysql.com/doc/refman/5.1/en/datetime.html</a>)</p>
  
  <p>The equivalent powershell command to get date/time in that format is:
  get-date -format G (<a href="https://technet.microsoft.com/en-us/library/ee692801.aspx" rel="nofollow">https://technet.microsoft.com/en-us/library/ee692801.aspx</a>)</p>
  
  <p>When I write that time to a variable and try to update a record, the record remains blank, and I'm assuming the datatype is off since I can write to integer and text columns.</p>
  
  <p>Anyone have any clue how to ensure proper datatype so I can update records?</p>