title: PHP PDO date time formats
body: <p>So I am using PHP PDO to load a class I have created called 'User' from mysql.  My object contains several fields including 3 date fields.  But for some reason, when I dump the object (using var_export) then I can see that the dates are stored differently.   1 as unix time and the others as date strings</p>
  
  <p>Here is the dump;</p>
  
  <pre><code>'createdtime' =&gt; '2013-04-19 09:36:42',
  
  'logintime' =&gt; '2013-04-25 01:32:50',
  
  'lastactiontime' =&gt; '1366880785',
  </code></pre>
  
  <p>All three fields are defined in MYSQL as DATETIME, so I don't understand why this has occured.</p>
  
  <p>Any ideas?</p>
  
  <p>My PHP code is;</p>
  
  <pre><code>$STH = $DBH-&gt;prepare('SELECT * from user where id=:id');        
  $STH-&gt;bindParam(':id', $id);
  $STH-&gt;execute();        
  
  $STH-&gt;setFetchMode(PDO::FETCH_CLASS, 'User');               
  $user = $STH-&gt;fetch();  
  </code></pre>
  
  <p>I must have done something wrong somewhere, but what?</p>