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
i used this code to convert my string datetime to epoch
new Date(<datetime string>').getTime()
for example :
let epoch = new Date('2016-10-11').getTime()
My answer is to convert current time to epoch time using JavaScript
const currentDate = Math.floor(new Date() / 1000);
console.log(currentDate); //whatever value it will print you can check the same value to this website https://www.epochconverter.com/ to confirm.