Search code examples
javascripthtmldateepoch

How to convert this kind of date to epoch format?


I have just made an HTML input which returns the following type of date :

2017-02-05T15:00

How can i input it in the epoch format ?


Solution

  • I you want to convert this kind of date in Epoch format, you just have to do it :

    var t1 = Date.parse("2017-02-05T15:00");