When coerced to a number, it's the number of milliseconds since January 1, 1970.
If you wanted to know the number of seconds since January 1, 1970, you could divide by 1000. Since JavaScript will do the coercion for you automatically you can pretty much treat a date object as if it were a number.
This is basically a utility routine that I use for debugging messages to say how long an operation took.
Here's an example of its use:
https://github.com/scripting/myWordEditor/blob/master/script...
It's especially nice because JavaScript automatically does real arithmetic on the division, so you get fractions of seconds displayed in the console.
I use this routine a lot. Helps me spot performance problems. Nice to have, not a crucial routine.
Hope this helps! ;-)
Typically I believe new Date() is current time/date (http://www.w3schools.com/js/tryit.asp?filename=tryjs_date_ne...) in my experience.
As far as your question how to deal with 5/8/2015, and 8/5/2015, to be honest I don't know that answer.
a Date can be constructed with either a number of milliseconds since the epoch or a string in a format recognised by the Date.parse() method (IETF-compliant RFC 2822 timestamps and also a version of ISO8601)
Or this is just a very case specific function and the input is already sanitized in a way that is prepared for this function?
github is here: https://github.com/scripting/pagepark/blob/master/lib/utils....