I need to recognize if a string has the proper mysql DB time stamp format in javascript. I wrote this regexp:
var regex = /([0..9]{4})-([0..9]{2})-([0..9]{2}) ([0..9]{2}):([0..9]{2}):([0..9]{2})/;
However when used with the string
var s = "2014-09-08 08:02:17";
if (regex.test){
console.log("OK");
}
It doesn't work. Can anyone tell me what I did wrong?
..with-..