Given that I have: mm, dd, yy, hh:mm, am/pm, what is the recommended/easiest way to convert that data into milliseconds from epoch?
Everytime I get an upvote on this answer, I'm reminded that my answer doesn't actually answer the question.
OP: If you can parse your string into the following format, you can use one of the other answers. MM/DD/YYYY HH:MM:SS AM EDT (It's important to specify the timezone; epoch is based on the meridian)
MM/DD/YYYY HH:MM:SS AM EDT
let milliseconds = new Date("1/20/1982 5:00 PM EST").getTime() console.log(milliseconds);
1.4m articles
1.4m replys
5 comments
57.0k users