Home > Blockchain >  Function of date and time in the 6ª column automatically
Function of date and time in the 6ª column automatically

Time:09-02

I need to improve my function I need a way to insert a date and time in the 6ª column automatically.

function processForm(formObject){
var url="my url";
var ss= SpreadsheetApp.openByUrl(url);
var ws=ss.getSheetByName("Requisição");

ws.appendRow([
formObject.c1,
formObject.c2,
formObject.c3,
formObject.c4,
formObject.c5,]);
}

CodePudding user response:

You just want a hard-coded timestamp in your routine? There is all kinds of documentation related dates in javaScript. I think this would work, you just might want to format the syntax.

function processForm(formObject) {
  var url = "my url";
  var ss = SpreadsheetApp.openByUrl(url);
  var ws = ss.getSheetByName("Requisição");
  var aDate = new Date();

  ws.appendRow([
    formObject.c1,
    formObject.c2,
    formObject.c3,
    formObject.c4,
    formObject.c5,
    aDate]);
}
  • Related