function secondsSince (when) {
var now = new Date ();
when = new Date (when);
return ((now - when) / 1000);
}
I'm assuming now returns seconds since some fixed point in time ( epoch ) when when someone passes in the 'when' argument, it must already be formatted a certain way, or node/js somehow managed to figure out the input? How would it deal with 5/8/2015 vs 8/5/2015Or 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....