Reputation: 175
var now = new Date();
var dayofmonth = now.getDay();
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.getRange('A7').setValue(dayofmonth);
dayofmonth returns: 31.12.1899 now.getDate() returns: 25.01.1900
Why does this not work?
i need only the day of the month like 29
Upvotes: 1
Views: 7679
Reputation: 909
The getDay function returns a number, from 0 to 6, representing the day of the week.
If it's returning another thing, try to delete the row, because the format of the cell could be modifying the value.
If you want the day of the month, then use:
now.getDate()
Upvotes: 3