Title |
Test
Find
TimeStamp
|
Expression |
^[1-9]{1}[0-9]{3}-(0[1-9]{1}|1[0-2]{1})-([0-2]{1}[1-9]{1}|3[0-1]{1}) ([0-1]{1}[0-9]{1}|2[0-3]{1}):[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$ |
Description |
Its validates a time stamp |
Matches |
2009-04-20 14:34:32 | 2010-03-09 12:59:00 | 1020-03-09 23:59:00 |
Non-Matches |
text | 2009-13-00 00:00:00 | 2009-12-20 23:60:00 |
Author |
Rating:
Danny
|
Source |
|
Your Rating |
|
Title: Correction
Name: http://mvark.blogspot.com
Date: 11/26/2009 2:28:35 AM
Comment:
The first example "2009-04-20 14:34:32" fails.
Change the 51st character in the expression to 0 to make it handle 20 in the day part of the date -
^[1-9]{1}[0-9]{3}-(0[1-9]{1}|1[0-2]{1})-([0-2]{1}[0-9]{1}|3[0-1]{1}) ([0-1]{1}[0-9]{1}|2[0-3]{1}):[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$
Title: Incomplete
Name: foobar
Date: 8/28/2009 5:11:34 AM
Comment:
Doesn't work when the date ends in 10 or 20.