so I give up...been trying to do this all day;
I have a string that supplies a date and time in the format dd/MM/yyyy hh:mm (04/12/2012 07:00
dd/MM/yyyy hh:mm
04/12/2012 07:00
You can use Date.parse(date).
Date.parse(date)
function epoch (date) { return Date.parse(date) } const dateToday = new Date() // Mon Jun 08 2020 16:47:55 GMT+0800 (China Standard Time) const timestamp = epoch(dateToday) console.log(timestamp) // => 1591606075000