I use the following cope in google sheets to copy a range of values from a row on a source sheet. It appends it to the destination sheet as values starting in the 2nd column. This works fine, but i now want to add on column 1 the date/time "localDateTime" that the script runs, but i just don't know how to get this done.
Can somebody help please
function copyInfo() {
// get date & time
var localDateTime = new Date()
// other variables
var ss = SpreadsheetApp.getActiveSpreadsheet();
var copySheet = ss.getSheetByName("Performance");
var pasteSheet = ss.getSheetByName("PortfolioTrend");
// get source range
// getRange(row, column, numRows, numColumns)
var source = copySheet.getRange(103,5,1,7);
// get destination range
var destination = pasteSheet.getRange(pasteSheet.getLastRow()+1,+2,1,7);
// copy values to destination range
source.copyTo(destination, {contentsOnly:true});
}