예제 #1
0
파일: Date.php 프로젝트: jasmun/Noco100
 /**
  * Checks whether a given date string is older than the given seconds
  *
  * @param $time expects date format YYYY-MM-DD HH:MM:SS
  * @param $seconds
  * @return bool
  */
 public static function isOlderThanSeconds($time, $seconds)
 {
     $dt = new DateTime($time, new DateTimeZone('UTC'));
     $offset = IfwPsn_Wp_Proxy_Blog::getGmtOffset();
     if (empty($offset)) {
         $offset = 0;
     }
     $timeTs = (int) $dt->format('U');
     return $timeTs + $seconds < time();
 }