Posted By

poot26 on 02/11/12


Tagged

php


Versions (?)

Php check for the top of the hour


 / Published in: PHP
 

Php check for the top of the hour

  1. <?php
  2. $minutes = date('i'); // We'll go by the minutes of the hour so that we don't have to compare to all 24 possible outcomes
  3.  
  4. if($minutes == '00'){ // if the minutes are 0 which should be the top of the hour
  5. echo "true"; // then pass a true to the refresh function
  6. } else{
  7. echo "false"; // if not, pass a false
  8. }
  9. ?>

Report this snippet  

You need to login to post a comment.