Getting Nan when calculate two date js

JavaScript
var res = new Date(dat1).getTime() > new Date(dat2).getTime()
Source

Also in JavaScript: