I have an error message as below while executing the following code. The same code was running fine 2 days ago. Please would you be able to shed some light?
"Error TypeError: data[j][0].setMilliseconds is not a function assignEditUrls @ Code.gs:17"
function assignEditUrls() {
var form = FormApp.openById('1PEopT9RzLFv-p5Esm1IXOF_-bzAnlsyzhAJ-qjWNBow');
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Form responses 1');
var data = sheet.getDataRange().getValues();
var urlCol = 237;
var responses = form.getResponses();
var timestamps = [], urls = [], resultUrls = [];
for (var i = 0; i < responses.length; i++) {
timestamps.push(responses[i].getTimestamp().setMilliseconds(0));
urls.push(responses[i].getEditResponseUrl());
}
for (var j = 1; j < data.length; j++) {
resultUrls.push([data[j][0]?urls[timestamps.indexOf(data[j][0].setMilliseconds(0))]:'']);
}
sheet.getRange(2, urlCol, resultUrls.length).setValues(resultUrls);
}