public function rule_iso_time($a)
{
$pattern = "/^([0-9]{2}):([0-9]{2})(?::([0-9]{2})(?:(?:\\.[0-9]{1,}))?)?\$/";
$msg = 'Must be a valid ISO time';
if (preg_match($pattern, $a, $matches)) {
if ($matches[1] > 24) {
return $this->fail($msg);
}
if ($matches[2] > 59) {
return $this->fail($msg);
}
if (isset($matches[3]) && $matches[3] > 59) {
return $this->fail($msg);
}
} else {
return $this->fail($msg);
}
}