Checks whether a time is valid.

@param int $hour   The hour
@param int $minute The minute
@param int $second The second

@return bool Whether the time is valid

@internal
506048
public static function checkTime($hour, $minute, $second)
    {
        return $hour >= 0 && $hour < 24 && $minute >= 0 && $minute < 60 && $second >= 0 && $second < 60;
    }
616473
public function setTime($hour, $minute, $second = 0)
        {
            parent::setTime($hour, $minute, $second);

            return $this;
        }
725138
public function dontSeeTimeIsInMins($time, $minutes) {
        \PHPUnit_Framework_Assert::assertNotEquals($minutes, $this->_GetNow()->diffInMinutes($this->_ParseDate($time), false));
    }
48975
protected function expires( $first, $second )
	{
		return ( $first !== null ? ( $second !== null ? min( $first, $second ) : $first ) : $second );
	}
1252883
protected function isTimestampValid($time, $now = null)
    {
        if (empty($now)) {
            $now = $this->getCurrentTimestamp();
        }

        return $time <= $now
            && $time > $now - 20 * 365 * 86400;
    }
581131
public function setMinute($minute)
 	{
		if(! in_array($minute, range(0, 59))) {
			throw new InvalidArgumentException('Minute must be between 0 and 59');
		}
 		$this->minute = $minute;
        return $this;
 	}
815697
private function validateCronSequence($minute = null, $hour = null, $day = null, $month = null, $weekday = null)
    {
        return [
            'minute' => $this->validateCronRange($minute, 0, 59),
            'hour' => $this->validateCronRange($hour, 0, 23),
            'day' => $this->validateCronRange($day, 1, 31),
            'month' => $this->validateCronRange($month, 1, 12),
            'weekday' => $this->validateCronRange($weekday, 0, 6),
        ];
    }
22084
protected function checkDateTimeOrder($format, $first, $second, $operator)
    {
        $firstDate = $this->getDateTimeWithOptionalFormat($format, $first);

        if (! $secondDate = $this->getDateTimeWithOptionalFormat($format, $second)) {
            $secondDate = $this->getDateTimeWithOptionalFormat($format, $this->getValue($second));
        }

        return ($firstDate && $secondDate) && ($this->compare($firstDate, $secondDate, $operator));
    }
959151
public function setTime( $hour, $minute, $second = 0, $microsecond = 0)
    {
        if( $this->isInfinity() ) {
            return $this;
        }
        $this->microseconds = $microsecond ? (int) $microsecond : 0;
        return parent::setTime( $hour, $minute, $second );
    }
1078591
public static function timeToSec($time)
    {
        // hh:mm:ss
        $split_time = explode(':', $time);
        $hour       = $split_time[0] * 3600;
        $minutes    = $split_time[1] * 60;
        $second     = $split_time[2] * 1;

        $timetosec = (int)($hour + $minutes + $second);

        return $timetosec;
    }
973739
public final function setSecond( int $second = null )
      : DateTime
   {

      if ( \is_null( $second ) )
      {
         $second = static::CurrentSecond();
      }

      return $this->setTimeParts( null, null, $second );

   }
999230
private function checkNameHour(string $time)
    {
        if (preg_match('/\s*\d{1,2}\s*(h|hour|hora|hs|hr|hrs)\s*/i', $time)) {
            $this->setCerteza("h", $time);
        }

        if (preg_match('/\s*\d{1,2}\s*(m|min|minuto)\s*/i', $time)) {
            $this->setCerteza("i", $time);
        }

        if (preg_match('/\s*\d{1,2}\s*(s|seg|segundo)\s*/i', $time)) {
            $this->setCerteza("s", $time);
        }
    }
850493
function isEqualTo( &$time )
    {
        $t1 =& $this->Time;
        if ( $time instanceof eZTime )
            $t2 = $time->timeOfDay();
        else
            $t2 = ( $time % self::SECONDS_A_DAY );
        return $t1 == $t2;
    }
53019
public static function compareDateWithHourMinuteSecond($date, $hour, $minute, $second = 0)
    {
        $date1 = DateTime::createFromFormat('Y-m-d H:i:s', sprintf('2000-01-01 %02d:%02d:%02d', $hour, $minute, $second));

        return self::compareTimeWithoutDate($date, $date1);
    }
757566
public static java.sql.Time getSqlTime(int hour, int minute, int second) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new java.util.Date(0));
        cal.set(Calendar.HOUR_OF_DAY, hour);
        cal.set(Calendar.MINUTE, minute);
        cal.set(Calendar.SECOND, second);
        cal.set(Calendar.MILLISECOND, 0);

        return getSqlTime(cal.getTime());
    }
820888
private function checkValidity($day, $hour, $minute)
    {
        // convert as integers
        $day_int = intval($day);
        $hour_int = intval($hour);
        $minute_int = intval($minute);

        // check value range
        if ($day_int  < 1 || $day_int > 31) {
            return false;
        }
        if ($hour_int   > 23) {
            return false;
        }
        if ($minute_int > 59) {
            return false;
        }

        return true;
    }
830685
public static function timestampFromDatepicker($date, $hour=NULL, $minute=NULL, $second=NULL) {
		
		/*
		 * TODO verify result with different timezones
		$dt = DateTime::createFromFormat('!d-m-Y', $date);
		if (is_a($dt, 'DateTime')) {
			$dt->setTime($hour, $minute, $second);
			$dt->getTimestamp();
		} else {
			return NULL;
		}
		*/

		$d = substr($date, 0, 2);
		$m = substr($date, 3, 2);
		$y = substr($date, 6, 4);
		$time = mktime($hour, $minute, $second, $m, $d, $y);
		
		return ($time ? $time : null);
		
	}