Home > Net >  How to display date in a cell using apps script
How to display date in a cell using apps script

Time:02-26

I have an apps script(for google sheets) that I would like to schedule everyday. How to I add a timestamp(preferably in PST) to indicate to users the last updated time? Example-In cell B2 of the tab called "Overview", I would like the following timestamp: "2/25/2022 02:03:54 PST"

CodePudding user response:

Add to your script

SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Overview').getRange('B2').setValue(new Date())

and défine in the sheet the format you need

  • Related