I want to display all the dates between two dates with year.
Eg: FromDate = 2012-01-01 ToDate=2013-05-01
Output should be :
January 2012
February 2012
March 2012
April 2012
...
May 2013
Thanks for any valuable inputs.
I want to display all the dates between two dates with year.
Eg: FromDate = 2012-01-01 ToDate=2013-05-01
Output should be :
January 2012
February 2012
March 2012
April 2012
...
May 2013
Thanks for any valuable inputs.
' Start from getting date with year and month from FromDate and 1 as a day '
Dim RealFromDate = new DateTime(FromDate.Year, FromDate.Month, 1)
While RealFromDate <= EndDate
Console.WriteLine(RealFromDate.ToString("yyyy MMM")
RealFromDate = RealFromDate.AddMonths(1)
End While