You are here

public static function TimeValidator::checkTime in Plug 7

Checks whether a time is valid.

@internal

Parameters

int $hour The hour:

int $minute The minute:

int $second The second:

Return value

bool Whether the time is valid

2 calls to TimeValidator::checkTime()
DateTimeValidator::validate in lib/Symfony/validator/Symfony/Component/Validator/Constraints/DateTimeValidator.php
Checks if the passed value is valid.
TimeValidator::validate in lib/Symfony/validator/Symfony/Component/Validator/Constraints/TimeValidator.php
Checks if the passed value is valid.

File

lib/Symfony/validator/Symfony/Component/Validator/Constraints/TimeValidator.php, line 38

Class

TimeValidator
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

public static function checkTime($hour, $minute, $second) {
  return $hour >= 0 && $hour < 24 && $minute >= 0 && $minute < 60 && $second >= 0 && $second < 60;
}