Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TimeValidator.php

function TimeValidator::checkTime

Checks whether a time is valid.

@internal

1 call to TimeValidator::checkTime()
TimeValidator::validate in vendor/symfony/validator/Constraints/TimeValidator.php
Checks if the passed value is valid.

File

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

Class

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

Namespace

Symfony\Component\Validator\Constraints

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal