How do you get the date of the current day, or the day before?


How to get the date

How do you get the date of the current day, or the day before? Do you use powershell scripts and write to a file?

Is there an easier way?



Thanks for sharing your case.

To get the current date, you can use the Constant Value action -

Then convert Date to String (using Clipboard)

Afterwards, you can do some text operations with it -
For example -

The Type Conversion support is planned to be introduced in the 1.1.9 release (December).


Hi @azinchuk,

Thanks for the quick return!



I’m unable to write the constant variable (current date) into text and can’t figure out why.

Also is it possible to get the date from the day before? (current date) - 1


You cannot use date variable in Enter keystrokes action.
It should be converted to a string first. You can see how to do it in this post How to write current date in notepad

1 Like

You can get the day before using data type conversion and text actions as shown below.

  1. Convert date to string and split the string variable.

  2. Convert the day to number and subtract a day.


  1. And convert number back to string and join strings.

The resulting string will contain the date before the current date.

Wow those are a lot of actions, eheh.

Thank you very much.

1 Like

Good Morning
Alesia, Is there a reason you added the 0 behind the ${day} in action 8 constant value?


@goncalo_vascbE No specific reason, just so it will have the format 02/03/18.

Alright, what about if the current date is day 1. Is it possible to get the last day from the previous month? This way will only subtract 1-1= day 0

1 Like

Hi @goncalo_vascbE,

I had the same problem too. I have used the power shell of Windows System to generate this information in txt file: frowning:. I have to open the file to get the information.

I did not find a solution at the time, but would be great if the RPA make calculations with date.

vote this feature

1 Like

@goncalo_vascbE @marcio_jesus you can get the day before using this custom script

1 Like

Hi every one …
Actually i enter a date value in to a string variable (mm/dd/yyyy) in this format and always i enter a sunday date , from that date i want to calculate the all previous(upto monday) day dates. For example i am enter previous sunday date ie(05/12/2019) ok, so here i calculate the saturday date ,firday date thusday date and so on upto monday date.(05/11/2019,05/10/2019,05/09/2019,05/08/2019,05/07/2019,05/06/2019) this is saturday to monday date, so i am also calculate the date in this ways .

Please help me ,Thank you…

In this case you just need to convert the string to a Date and then use on the scripts from the topic shared above

Thanks for your suggestion,
But think is that how i used that in because i am new in rpa, can you explain me with example .
Please .

Here it is

convert to date variable

calculate another date

I try to execute same code for confirmation purpose but its showing error image ,


Have you created a variable ‘friday_date’ that you use in the script?

You can read how to use custom actions and see some examples in the knowledge base

Yes i have create the variable ‘friday_date’ in the script.