I have two dates, start and end dates and also Series End Date. I want to generate a weekly and monthly array of Dates for all specify period using Linq. So for example
var start = DateTime.Parse("08/17/2018");
var end = DateTime.Parse("09/17/2018");
var SeriesEndPeriod = DateTime("12/31/2022")
I want to generate array of all Dates for the start and end dates till the SeriesEndPeriod .Any help will be appreciated
Then you can filter and add dates to each list according to
DayOfWeek attribute of DateTime which shows which day of current week , and use Month Property which you will get the month component of the date represented
.
Member
50 Points
182 Posts
Generate a list of array for weeks and months for a given two dates between a specify Date Range
Feb 08, 2019 05:35 PM|denkyira|LINK
I have two dates, start and end dates and also Series End Date. I want to generate a weekly and monthly array of Dates for all specify period using Linq. So for example
var start = DateTime.Parse("08/17/2018");
var end = DateTime.Parse("09/17/2018");
var SeriesEndPeriod = DateTime("12/31/2022")
I want to generate array of all Dates for the start and end dates till the SeriesEndPeriod .Any help will be appreciated
All-Star
18815 Points
3831 Posts
Re: Generate a list of array for weeks and months for a given two dates between a specify Date Ra...
Feb 11, 2019 02:55 AM|Nan Yu|LINK
Hi denkyira,
You can firstly get the dates beween the date range :
https://stackoverflow.com/questions/3738748/create-an-array-or-list-of-all-dates-between-two-dates/3738781#3738781
Then you can filter and add dates to each list according to DayOfWeek attribute of DateTime which shows which day of current week , and use Month Property which you will get the month component of the date represented .
Best Regards,
Nan Yu