I want to validate a 12-Hours time format like (01:05 PM) in PHP, Javascript and HTML.
I tried this:
((([1-9])|(1[0-2])):([0-5])(0|5)\s(A|P)M)
But I don't know why it doesn't work.
Try ,
^(1[0-2]|0?[1-9]):[0-5][0-9] (AM|PM)$
You may test here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With