how to get date string from date object in javascript code example
Example 1: convert date to string javascript
var d = new Date();
var n = d.toDateString();
Example 2: string date to date in javascript
var ts = '1471793029764';
ts = Number(ts); // cast it to a Number
var date = new Date(ts); // works
var invalidDate = new Date('1471793029764'); // does not work. Invalid Date