Just type today's Day

Hello
I am trying to use ui.vision RPA Extension in Firefox to type todays day in a text box as a number field ( example: 08), then month in a different box (example: 04), then year in a seperate box (example: 2021)

I have seen the following code to use day/month/year

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

However, how would I break this down to have just day, then just month, then just year? I feel if I tear this formula apart I will break it :slight_smile:

My command is: type
Target: id=id-applicationDate.day
Value: 08

Would I change this to

Command: type
Target: id=id-applicationDate.day
value: ${result}

and have the execute script code as:

executeScript | var d= new Date(); d.getDate(); | result

Thank you

Day:

executeScript | var d= new Date(); return d.getDate(); | result

Month:

executeScript | var d= new Date(); var m=((d.getMonth()+1)<10)?'0'+(d.getMonth()+1):(d.getMonth()+1); return m; | result

Year:

executeScript | var d= new Date(); return d.getFullYear(); | result

1 Like

It works! :smiley:

Thanks for helping, I am learning so much, like a completely new language.