RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Short datetime en-US
Expression
^(([0]\d)|([1][0-2])|(\d))[/](([0-2]\d)|([3][0-1])|(\d))[/][2][0]\d{2}[,]\s(([0]\d)|([1][0-2])|(\d))[:][0-5]\d\s[AP][M]
Description
This is basic datetime validator that does bother with seconds and enforces slashes, a comma after the date, as well as a year that must start with "20". Morning and evening are represented by "AM" or "PM" only.
Matches
1/31/2086, 9:50 AM | 08/04/2082, 09:13 PM | 1/2/2000, 1:12 PM
Non-Matches
1/31/2086 9:50 AM | 08/04/2082, 09:13 | 1/2/1900, 1:12 PM
Author Rating: Not yet rated. Dave Hull
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials