Search code examples
javascriptjavascript-framework

Get epoch for a specific date using Javascript


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


Solution

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

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