input-> 09/07/2021
output → Aug-21
I want previous month name by given input.
input-> 09/07/2021
output → Aug-21
I want previous month name by given input.
Hey,
Could you try this ?
DateTime.Now.AddMonths(-1).ToString(“MMM-yy”)
its taking the system date,
but here we have to take date in input variable,
Ok. So use this one:
Convert.ToDateTime(“09/07/2021”).AddMonths(-1).ToString(“MMM-yy”)
instead: “09/07/2021” you can use your variable of string.
thankyou
you’re welcome
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.