title: Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string
body: <p>I get this error </p>
  
  <blockquote>
    <p>( ! ) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (06-28-2014 07:43:58 ) at position 0 (0): Unexpected character' in /Users/matt/Desktop/Likes/forgot/activate.php on line 17</p>
  </blockquote>
  
  <p>When trying to do this </p>
  
  <pre><code>//DB query
  $stmt = $con-&gt;prepare("SELECT token_created_at from reset WHERE token = :urltoken");
  $stmt-&gt;bindValue(':urltoken', $_GET['token']);
  $stmt-&gt;execute();
  $stmt-&gt;setFetchMode(PDO::FETCH_ASSOC);
  while($row = $stmt-&gt;fetch()) {
       $token_created_at = $row['token_created_at'];
  }
  
  //Remove after testing
  echo $token_created_at;
  
  $my_dt = new DateTime($token_created_at);
  
  //Modify error
  $expires_at = $my_dt-&gt;modify('+1 hour');
  
  //Return current time to match
  $current_time = date('m-d-Y H:i:s ', time());
  </code></pre>
  
  <p>Line 17 is <code>$my_dt = new DateTime($token_created_at);</code> and this is my time format <code>06-28-2014 07:43:58</code>.</p>
  
  <p>This is how I generate <code>token_created_at</code>, <code>$time_gen = date('m-d-Y H:i:s ', time());</code>.</p>