How to get only previous year from the current one

How to get only previous year from the current one

Get Current, Previous, and Next Year in UiPath - JD Bots.

@Rawan_Ghurab ,
To get the previous Year try this

Now.AddYears(-1).ToString("yyyy")

Output :
image

Regards,

Hi @Jithesh_R

To get only the Previous Year

DateTime.Now.AddYears(-1).ToString("yyyy")

To get current Date and month with Previous Year

DateTime.Now.AddYears(-1).ToString("dd-MM-yyyy")

Regards
Gokul