conditional time compare
<p>I'm using this within my sql code to record the time</p>

<pre><code>`dt` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
</code></pre>

<p>Output example : <code>2012-03-15 19:51:07</code> </p>

<p><strong>Question 1</strong> what i want to do is to compare between time recoreded before and the time at certain moment.</p>

<pre><code>$tr = "2012-03-15 19:51:07"; // time recorded
</code></pre>

<p>and </p>

<pre><code>$tn = "2012-03-16 8:33:23"; // time now
</code></pre>

<p>so that i can say</p>

<pre><code>if ($tn &gt; $tr){
echo "something";
}else{
echo "something else";
}
</code></pre>

<p><strong>Question 2</strong> what if i wanna say if <code>$tn &gt; $tr</code> by certain exact number of hours (example 3 hours) show something and else show something else. (conditional compare)</p>

<p>so can we really compare time ! ~thanks</p>
