title: Comparing time in PHP
body: <p>I am comparing a deadline time from my database which is on a 24-hour format (like 3:00 = 15:00) to the time now.</p>
  
  <p>For example, if a student wasn't able to submit on the due time, an upload link will be greyed out.</p>
  
  <p>I'm okay with the date comparison, my problem is the time.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>$date = date("Y-m-d");
  $time = strtotime(date('G:i:s'));
  $deadtime = strtotime($r['upload_deadtime']);
  
  /*------$deadtime = 15:00:00 ---------*/
  
  if(date($r['upload_deadline']) &gt;= $date &amp;&amp; $deadtime &gt; $time){
  
  echo '&lt;td&gt;&lt;a href="stud_prep.php"&gt;upload&lt;/a&gt;&lt;/td&gt;';                 
  }
  else{
  echo '&lt;td&gt;&lt;a title="your too late! haha!" style="color:grey"&gt;upload&lt;/a&gt;&lt;/td&gt;';  
  }
  </code></pre>
  
  <p>Update: let's just forget about the date comparison, what I'm trying to say is how can I compare my deadline time (which is on a 24-hour format (like 3:00:00 = 15:00:00)) to the time now.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>$time = strtotime(date('G:i:s')); /*which returns 23:15:42 instead of 14:15:42 */
  $deadtime = strtotime('15:00:00');
  
  
  if($deadtime &gt; $time){
  
  echo '&lt;td&gt;&lt;a href="stud_prep.php"&gt;upload&lt;/a&gt;&lt;/td&gt;';                 
  }
  else{
  echo '&lt;td&gt;&lt;a title="your too late! haha!" style="color:grey"&gt;upload&lt;/a&gt;&lt;/td&gt;';  
  }
  </code></pre>