This is what i tried
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Farm" ) { //checks that we're on Sheet1 or not
var r = s.getActiveCell();
if( r.getColumn() == 5 ) { //checks that the cell being edited is in column A
var nextCell = r.offset(0, -3);
if( nextCell.getValue() === '' ) //checks if the adjacent cell is empty or not?
nextCell.setValue(new Date());
{
var time = new Date();
time = Utilities.formatDate(time, "", "dd-mm-yyyy' '");
nextCell.setValue(time);
}
}
}
}
I want to type something in column E and have the date in column B, I want this to be static like a timestamp. I'm super new to coding/scripting. Anyone know how to remove the hh:mm:ss from the date?