Convert YYYY/MM/DD to MM/DD/YY

I need to get todays date in the format of MM/DD/YY. I’ve gotten this code below but that retrieves the date in YYYY/MM/DD format. Is there a way to make this into the format I need?

“Command”: “executeScript”,
“Target”: “var d= new Date(); var m=((d.getMonth()+1)<10)?‘0’+(d.getMonth()+1):(d.getMonth()+1); d.getFullYear()+”-"+m+"-"+d.getDate();",
“Value”: “Today”

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);

2 Likes

You are expert in javascript, great job !