Originally Posted by xelawho
a fabulously unreliable approach... this:
var d=new Date("2013-01-25 22:31:55.809231")
gives NaN in FF and IE and 25 in Chrome... regExing it, as per Ali's suggestion would appear much more sensible
I didn't say to convert it to a date object that way - just that it needs to be converted to a date object in order to confirm that it is an actual date.
Ali's suggestion would not work correctly if the value supplied were "2013-52-76 92:81:85.809231" as it would simply return part of the garbage supplied instead of recognising that it is garbage.
rnd_me has supplied the correct fix for being able to load it into a date object properly.
Helping others to solve their computer problem at http://www.felgall.com/