Get epoch for a specific date using Javascript

Asim Zaidi picture Asim Zaidi · Jul 30, 2010 · Viewed 103.7k times · Source

How do I convert 07/26/2010 to a UNIX timestamp using Javascript?

Answer

Michael Mrozek picture Michael Mrozek · Jul 30, 2010

You can create a Date object, and call getTime on it:

new Date(2010, 6, 26).getTime() / 1000