Date.toISOString() wrong result in some cases

Date.prototype.toISOString() used to return seconds in the milliseconds part if the latter were `0`, and even a double if milliseconds were multiple of 10 or 100. Fixed it. Also removed the excessive `date` variable.