I'm writing custom function for google sheets. One part should calculate delta of two difference times.
function timeOut(input) {
var difference = input[0][1]-input[0][0];
var output = new Date(difference);
return output;
}
Variable difference contains zero. The problem is that new Date(0) is returning
Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
which instead of
Thu Jan 01 1970 00:00:00 GMT+0100 (CET)
So difference of 9 hours minus 9 hours is 1 hours, which is obviously wrong.
Could you pinpoint me, what I'm doing wrong ?