daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. expires:
  2. <?php
  3.         $expires = strtotime('tomorrow', time());
  4.         echo $expires;
  5.         echo ' ('.strftime('%c', $expires).')';
  6.  
  7. ?>
  8.  
  9. <br><br>
  10.  
  11. timediff (seconds until "expires"):
  12. <?php
  13.         $timediff = $expires - time();
  14.         echo $timediff;
  15. ?>
  16.  
  17. <br><br>
  18.  
  19. filetime:
  20. <?php
  21.         $filetime = @filemtime('/filepath/tmp/element');
  22.         echo $filetime;
  23.         echo ' ('.strftime('%c', $filetime).')';
  24. ?>
  25.  
  26. <br><br>
  27.  
  28. <?php
  29.         echo 'filetime + timediff: ';
  30.         echo $filetime + $timediff;
  31.         echo ' ('.strftime('%c', $filetime + $timediff).')';
  32.  
  33.         echo ' -- current time: ';
  34.         echo time();
  35.         echo ' ('.strftime('%c').')';
  36.         echo ' -- ';
  37.         echo ($filetime + $timediff < time()) ? 'expired' : 'not expired';
  38. ?>
  39.  
  40. <br><br>
  41. <?php
  42.         echo 'diff: ';
  43.         echo $filetime + $timediff - time();
  44. ?>
RAW Paste Data
Top