Adding 10 minutes to a date from mysql datetime and comparing it to the time now
<p>I can't figure out how to add 10 minutes to a time I am getting from mysql database the field structure is datetime.</p>

<p>Current code </p>

<pre><code>$nowtime = date('Y-m-d h:i:s');

$timeoflastlogin = $db-&gt;gettime();

//ADD 10 MINS TO TIME LAST ATTEMPTED 
$endtime = strtotime('+ 10 minutes', $timeoflastlogin );
//$endtime = date('Y-m-d h:i:s', strtotime('+ 10 minutes', $timeoflastlogin );
</code></pre>

<p>This displays "
    2011-09-07 13:53:43 &lt; time of last login
    2011-09-07 03:56:15 &lt; now time
    2611&lt; endtime - this is supposed to be time of last +10 mins "</p>

<p>I cannot work out how to add 10 mins to the time/date from mysql, I need to do this and then set a command to compare the time now and of last login so if it has been 10 minutes I can stop the user trying to login again!</p>

<p>Thanks for your help</p>
