I have a script that changes the name of a sheet based on a cell in that sheet. Which works. But I am trying to change the sheet name to a particular date format - 'August 1, 2022'. But the sheet name appears as 'Tue Aug 01 2028 08:00:00 GMT+0100 (British Summer Time)' I have tried to add the code '.setNumberFormat('dd.MM.yyyy');' to my code but this doesn't work.
Any ideas? My current code is
function changeSheetName( ){
var As = SpreadsheetApp
.getActiveSpreadsheet( )
.getActiveSheet( )
As.setName(As.getRange("A1")
.getValue( ) )
.setNumberFormat('dd.MM.yyyy');
}
function onEdit( ){
changeSheetName( )
}