>The problem here that this format is set('date') dependent. What if I'm using 01-01-2004 format? Also AA allows to enter any letter, and I need to allow only AM or PM. Moreover, it depends, am I using military time format or not.
You're probably using the 24-hour format hh:mm; the military time is hhmm (without the colon).
I sometimes wish AM/PM was never invented... it's so ridiculously illogical.