[Validator] Fixed time constraint (support formats H, H:i and H:i:s)

This is a reactivated PR, see #9163

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -