See time is in a given number of minutes.

@param string $time
@param int    $minutes
172384
public function seeTimeIsInMins($time, $minutes) {
        \PHPUnit_Framework_Assert::assertEquals($minutes, $this->_GetNow()->diffInMinutes($this->_ParseDate($time), false));
    }
53653
public function add($key, $value, $minutes)
    {
        if (! is_null($this->get($key))) {
            return false;
        }

        $this->put($key, $value, $minutes);

        return true;
    }
603850
public function add($key, $value, $minutes = 0)
    {
        if ($this->exists($key)) {
            return false;
        }
        return $this->put($key, $value, $minutes);
    }
1237508
public function friendlyTime($time)
    {
        $time = $this->formatTime($time);
        (int) $s = 60;
        (int) $hour = $s * $s;
        (int) $day = $hour * 24;
        (int) $week = $day * 7;
        (int) $month = $day * 30;
        (int) $year = $month * 12;
        if ($time <= 60) {
            $ago = ($time === 0 || $time === 1) ? printl('z:format:just:now') : sprintf(printl('z:format:secs'), $time).' '.printl('z:format:ago');
        } elseif ($time >= $s && $time < $hour) {
            $ago = (round($time / $s) === 1) ? '1 '.printl('z:format:min').' '.printl('z:format:ago') : sprintf(printl('z:format:mints'), round($time / $s)).' '.printl('z:format:ago');
        } elseif ($time >= $hour && $time < $day) {
            $ago = (round($time / $hour) === 1) ? '1 '.printl('z:format:hour').' '.printl('z:format:ago') : sprintf(printl('z:format:hours'), round($time / $hour)).' '.printl('z:format:ago');
        } elseif ($time >= $day && $time < $week) {
            $ago = (round($time / $day) === 1) ? '1 '.printl('z:format:day').' '.printl('z:format:ago') : sprintf(printl('z:format:days'), round($time / $day)).' '.printl('z:format:ago');
        } elseif ($time >= $week && $time < $month) {
            $ago = (round($time / $week) === 1) ? '1 '.printl('z:format:week').' '.printl('z:format:ago') : sprintf(printl('z:format:weeks'), round($time / $week)).' '.printl('z:format:ago');
        } elseif ($time >= $month && $time < $year) {
            $ago = (round($time / $month) === 1) ? '1 '.printl('z:format:month').' '.printl('z:format:ago') : sprintf(printl('z:format:months'), round($time / $month)).' '.printl('z:format:ago');
        } elseif ($time >= $month) {
            $ago = (round($time / $month) === 1) ? '1 '.printl('z:format:year').' '.printl('z:format:ago') : sprintf(printl('z:format:years'), round($time / $year)).' '.printl('z:format:ago');
        }

        return $ago;
    }
929773
public function setMinValidity($time) {
        if (!is_int($time)) throw new IllegalTypeException('Illegal type of parameter $time: '.gettype($time));
        if ($time < 0)      throw new InvalidArgumentException('Invalid argument $time: '.$time);

        $this->minValidity = $time;

        return $this;
    }
1129042
public function seeTimeWasInSecs($time, $seconds) {
        \PHPUnit_Framework_Assert::assertEquals($seconds, $this->_ParseDate($time)->diffInSeconds($this->_GetNow(), false));
    }
24184
public final function moveMinutes( int $minutes = 1 )
      : DateTime
   {

      return $this->move( new \DateInterval( 'PT' . \abs( $minutes ) . 'M' ), $minutes < 0 );

   }
933369
public function put($key, $value, $minutes = 0) {
        if ($minutes == 0) {
            $this->client->set($key, serialize($value));
        } else {
            $this->client->set($key, serialize($value), null, $minutes * 60);
        }
    }
1049030
public function end($time = null)
	{
		// The timer should be ended only once.
		if(is_null($this->endTime))
		{
			$this->endTime = $time ?: microtime(true);
		}
	}
770209
private function prepareTime(string $times)
    {
        foreach (preg_split('/\W/i', $times) as $time) {
            $this->getDatePart($time);
        }
    }
1256611
public function set_minute($minute) {
        if ($minute === 'R') {
            $minute = mt_rand(self::HOURMIN, self::HOURMAX);
        }
        $this->minute = $minute;
    }
715655
public function put($key, $value, $minutes)
    {
        if ($minutes instanceof \Datetime) {
            $seconds = $minutes->getTimestamp() - time();
        } else {
            $seconds = $minutes * 60;
        }

        $this->cache->save($key, $value, $seconds);
    }
49056
public static function isValidTime($time)
    {
        if (preg_match('^(0|1|2)[0-9]([:](0|1|2|3|4|5)[0-9]){2}$', $time)) {
            $hour   = (int)substr($time, 0, 2);
            $minute = (int)substr($time, 3, 2);
            $second = (int)substr($time, 6, 2);
            if ($hour < 24 && $minute < 60 && $second < 60) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
217185
public static function isThisWeek($time): bool
    {
        return (self::factory($time)->format('W-Y') === self::factory()->format('W-Y'));
    }
569956
static public function validate($time)
    {
      // Check if date is a string
      if(is_string($time) && strlen(trim($time)) > 0)
        return false;
        
      // Check if date matches pattern
      if(!preg_match('/^' . self::PATTERN . '$/', $time, $matches))
        return false;
          
      // Extract values from time
      if(count($matches) == 5)
        list($original, $hours, $minutes, $seconds, $microtime) = $matches;
      else
        list($original, $hours, $minutes, $seconds) = $matches;
              
      // If microtime is set at it to seconds
      if(isset($microtime))
        $seconds += $microtime;
                
      // Check if all values are valid
      if(!self::validateTime($hours, $minutes, $seconds))
        return false;
                  
      return true;
    }
661780
public function put($value, $minutes)
	{
		\Cookie::set($this->getKey(), serialize($value), $minutes * 60);
	}
1237917
public function put($key, $value, $minutes)
    {
        if ($minutes instanceof \Datetime) {
            $seconds = $minutes->getTimestamp() - time();
        } else {
            $seconds = $minutes * 60;
        }
        $this->redis->setex($this->decorateKey($key), $seconds, $value);
    }