View Single Post
Old 01-26-2013, 01:19 AM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I think a better question might be: Where did that string come from?

If it came from server-side code, which seems pretty darned likely to me, then why not fix the problem in the server.

Or, if you know it came from reliable server-side code, then even the first answer by LogicAli is sufficient. I doubt seriously that he is worried about some user entering a date time string like that willy-nilly. Why validate it via JS when *almost* surely it comes from some computerized process (likely a DB field?) in the first place.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote