← Pattern Library PATTERN
Date · Time
/\b([01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?\b/g
Date · Time Flags: g
Description
Matches 24-hour times from 00:00 to 23:59, with seconds (:SS) being optional. Each of the hours, minutes, and seconds is limited to its valid range. Useful for parsing log timestamps or schedules.
Example Matches
09:30
23:59:59
00:00
Test String
Meeting 09:30, deadline 23:59:59, invalid 24:61
Open this pattern in the tester
Other Patterns