var myDate = new Date("2013/1/16");
var str = "2013/1/16";
var strToDate = new Date(str);
Date.parse(dateString)
//dateString is like 2020-10-10 / 2020-10-10T10:20:20
var d = Date.parse("March 21, 2012");
// input 28/10/2018
// input DD/MM/YYYY
export const convertToDate = (dateSting) => {
const [day, month, year] = dateSting.split("/");
return new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
}
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