title: Store timestamp using PHP:date() or MySQL:FROM_UNIXTIME()?
body: <p>This may be trivial, but when I want to store a timestamp value (returned by, say, <code>time()</code>) into a <code>TIMESTAMP</code> column in my MySQL table, which of these two are preferable:</p>
  
  <pre><code>function storeTime($timestamp) {
     // Option one:
     $query = "INSERT INTO faketable (datecol) VALUES (FROM_UNIXTIME(".$timestamp."))";
     // Option two:
     $query = "INSERT INTO faketable (datecol) VALUES (".date("YY-MM-DD HH:MM:II", $timestamp).")";
  }
  </code></pre>
  
  <p>Is there even a difference?</p>
  
  <p><b>EDIT:</b> Sorry, meant <code>date()</code>, not <code>strtotime()</code>...</p>
  
  <p><b>EDIT 2:</b> <code>NOW()</code> doesn't cut the mustard, the actual timestamp is a paramater sent to my method. I don't know what it is in advance.</p>
  
  <p><b>EDIT 3:</b> I really shouldn't be asking questions at this time of night. The column in question is, in fact, a <code>TIMESTAMP</code> column, not a <code>DATETIME</code> column.</p>