title: Type error in Google Sheet script
body: <p>In the Google sheet script editor, I'm using the code below to insert the Edit response link in the spreadsheet along with the form data.</p>
  
  <pre><code>function assignEditUrls() {
    var form = FormApp.openById('xxxxxxxxxxxxxxxxxxxxxxxx');
      //enter form ID here
  
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Form Responses');
  
      //Change the sheet name as appropriate
    var data = sheet.getDataRange().getValues();
    var urlCol = 3; // column number where URL's should be populated; A = 1, B = 2 etc
    var responses = form.getResponses();
    var timestamps = [], urls = [], resultUrls = [];
  
    for (var i = 0; i &lt; responses.length; i++) {
      timestamps.push(responses[i].getTimestamp().setMilliseconds(0));
      urls.push(responses[i].getEditResponseUrl());
    }
    for (var j = 1; j &lt; data.length; j++) {
      resultUrls.push([data[j][1]?urls[timestamps.indexOf(data[j][0].setMilliseconds(0))]:'']);
    }
    sheet.getRange(2, urlCol, resultUrls.length).setValues(resultUrls);  
  }
  </code></pre>
  
  <p>Whilst this was working as it should up till last week, when the script is now run I get the following error:</p>
  
  <pre><code>TypeError: Cannot find function setMilliseconds in object . (line 18, file "Code")
  </code></pre>
  
  <p>Any thoughts or alternative solutions would be gratefully received.</p>