# [Perl 5] `-p`, <s>27</s> <s>22</s> 18 bytes *Saved 4 bytes when @NahuelFouilleul pointed out that it doesn't need to be a look-ahead in the regex* <!-- language-all: lang-perl --> $_=!/[6-9].(..)*$/ [Try it online!][TIO-k7aofpg5] [Perl 5]: https://www.perl.org/ [TIO-k7aofpg5]: https://tio.run/##K0gtyjH9/18l3lZRP9pM1zJWT0NPT1NLRf//f0MLIy4jY1NLU8t/@QUlmfl5xf91fU31DAwN/usW5AAA "Perl 5 – Try It Online" Since the input is guaranteed to be less than 236000, the hours can be ignored as they will always be valid. This pattern match checks if there is a 6, 7, 8, or 9 in the tens digit of the minutes or seconds. The match is then negated to get truthy for valid dates and falsy for invalid ones.