How to obtain year of previous month like "yyyy"?

The thing is that I need to get previous year of last month based on current day. For example:

  1. today is january, and current year is 2020 and the previous month the year was 2019 so it should return 2019.
  2. If I run it in february should return 2020.

I will really appreciate any suggestions.
Regards.

1 Like

Hi
kindly use this expression
Now.AddMonths(-1).Year.ToString

Cheers @amaidana

1 Like

Thanks Palaniyappan…

Cheers @amaidana

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.