how to check if a string format is correct in nodejs code example
Example 1: check if string is datestring javascript
moment("2015-06-22T13:17:21+0000", moment.ISO_8601, true).isValid(); // true
Example 2: how to verify timestamp format in javascript
var valid = (new Date(timestamp)).getTime() > 0;
var valid = (new Date('2012-08-09')).getTime() > 0; // true
var valid = (new Date('abc')).getTime() > 0; // false