How to change todays date format to YYYY-MM-DD

I have done some research and have figured out how to get today’s date w/

var d= new Date(); var m=((d.getMonth()+1)<10)?‘0’+(d.getMonth()+1):(d.getMonth()+1); return m+"/"+d.getDate().toString().padStart(2, “0”)+"/"+d.getFullYear().toString().substr(2);

This outputs MM/DD/YY

However, for my form the date HAS to be YYYY-MM-DD

var d= new Date(); var m=((d.getMonth()+1)<10)?'0'+(d.getMonth()+1):(d.getMonth()+1); return d.getFullYear()+"-"+m+"-"+d.getDate();

will get you the format YYYY-MM-DD

Reference: executeScript, execute script, Arrays - Selenium IDE Commands Tutorial