Minusing a month and converting to format yyyy/mm/dd

Hello,

I want to get todays date minus a month and then convert it to yyyy/mm/dd.

Currently I have
todaysdateminusmonth=now.AddDays(-30)

todaysdateformatted=todaysdateminusmonth(“yyyy/mm/dd”)

It does not work at the second stage.

Any help would be appreciated

This link may help you!

@mzucker Please try like below

todaysdateformatted=todaysdateminusmonth.ToString(“yyyy/MM/dd”)

instead of adding days add month
i.e. Date.Now.AddMonths(-1).tostring(“yyyy/MM/dd”)

2 Likes