Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php validate date format dd mm yy hh mm ss

/^(?:[0-9]{4}-[0-9]{2}-[0-9]{2})?(?:[ T][0-9]{2}:[0-9]{2}:[0-9]{2})?(?:[.,][0-9]{3})?/gm
  
2019-04-29 this line has only date
2019-04-29 14:10:32 this line has date and time without the "T" separator
2019-04-29T14:10:32 this line has date and time with the "T" separator
2019-04-29T14:10:36 this line has no milliseconds
2019-04-29 14:10:32,999 this line has milliseconds using comma, but without the "T" separator
2019-04-29T14:10:32,999 this line has milliseconds using comma
2019-04-29T14:10:36.000 this line has milliseconds using decimal point
Source by www.regextester.com #
 
PREVIOUS NEXT
Tagged: #php #validate #date #format #dd #mm #yy #hh #mm #ss
ADD COMMENT
Topic
Name
1+4 =