예제 #1
0
 public function test_unix()
 {
     $time = strtotime('2011-11-01 15:00:00');
     Time::set($time);
     $this->assertEquals(Time::unix(), $time);
 }
예제 #2
0
 static function uTimes($options)
 {
     $updateTime = new Time($options['update']);
     $updateTimeUnix = $updateTime->unix();
     if ($updateTimeUnix < time()) {
         Debug::toss('uGet Cache update time is previous to current time', 'CacheException');
     }
     if ($options['expiry']) {
         $expiryTimeUnix = $updateTime->relative('+' . $options['expiry'] . ' seconds')->unix();
         $times['nextExpiry'] = $expiryTimeUnix - time();
     }
     $times['nextUpdate'] = $updateTimeUnix;
     return $times;
 }