Home > Regular Expressions > Regular Expressions: Time hh:mm validation 24 hours format

Regular Expressions: Time hh:mm validation 24 hours format

20:11

Marek Śliwiński Leave a comment Print This Post  (1,500) Go to comments

Check if time is in 24h format hh:mm For example these values are valid: 01:00 (leading zero is mandatory), 05:01, 13:00, 23:59. For example these values are not valid: 24:00, 1:30, 05:60, 12|34 etc.

Regex:

([0-1]\d|2[0-3]):([0-5]\d)
Share and Enjoy:
  • DotNetKicks
  • Digg
  • del.icio.us
  • Wikio IT
  • Google Bookmarks
  • Facebook
  • Print
  1. No comments yet.
  1. No trackbacks yet.

Subscribe without commenting