In a HTML table, i need to display a date(Month/Year) & the 6 previous and next months.
this code displays the actual month and year
<th>
<%=
String.Format("{0:MMMM}", DateTime.Now).ToString() + "/" + DateTime.Now.Year%>
</th>
I can’t find how to get the previous/next months and how to update the year in case the year has changed.
Thanks in advance for your help…
DateTime.Now.AddMonths(1)andDateTime.Now.AddMonths(-1)