How to open a specific tab based on today’s date (google sheets)


I’ve made a ‘Google Sheets’ with 31 tabs for the dates of the month (1-31)
How do I write a script that makes the spreadsheet open to that days tab?
eg. open tab 25 if today is Aug 25th

I imagine (from a few other scripts I’ve seen) that it’s something like:

function onOpen() {
  var date = getDate(now,'d')
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  ss.setActiveSheet(ss.getSheets()(date));  
}

but I’ve never used this programming language and have no idea.

also, the tabs are named 1, 2, 3.. etc if that’s any easier to code

Thanks, Joe