Google App Script Utilities.formatDate(new Date() adding days to today -
i have script places today's date (the date when script run) in various cells in spreadsheet in sydney time looks this:
cell.setvalue("" + utilities.formatdate(new date(), "utc+10", "dd-mm-yyyy"));
this works fine there cells need place not today's date few days or weeks in future - eg cells need filled value 5 days when script run, 2 weeks, etc. how go doing this? none of variations can find online seem work properly.
thanks!
try this:
var nextday = new date() nextday = nextday.setdate(nextday.getdate()+1); cell.setvalue(utilities.formatdate(new date(nextday), "utc+10", "dd-mm-yyyy"));
or
cell.setvalue(utilities.formatdate(new date(new date().setdate(new date().getdate()+1)), "utc+10", "dd-mm-yyyy"))
Comments
Post a Comment