You are here

public static function TimeValidator::checkTime in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Constraints/TimeValidator.php \Symfony\Component\Validator\Constraints\TimeValidator::checkTime()

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 vendor/symfony/validator/Constraints/DateTimeValidator.php
Checks if the passed value is valid.
TimeValidator::validate in vendor/symfony/validator/Constraints/TimeValidator.php
Checks if the passed value is valid.

File

vendor/symfony/validator/Constraints/TimeValidator.php, line 37

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;
}