TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kwasi Denkyira
1.5k
197
14.8k
How to get the First, second and third Monday of the month b
Apr 10 2019 11:55 AM
I want to get the first, second and third Monday of the Month between two dates. I can get the first Monday of the month but not between two day. Below is my code. Any help will be appreciated.
class
Program
{
public
class
BusinessWeekDays
{
public
DateTime Tuesday;
public
DateTime Monday;
}
static
void
Main(string[] args)
{
var StartDate = DateTime.Parse(
"04/25/2019"
);
var SeriesEndDate = DateTime.Parse(
"09/30/2019"
);
for
(
int
mth = 1; mth <= 12; mth++)
{
DateTime dt =
new
DateTime(2010, mth, 1);
while
(dt.DayOfWeek != DayOfWeek.Monday)
{
dt = dt.AddDays(1);
}
Console.WriteLine(dt.ToLongDateString());
}
Console.ReadLine();
//for (var i = StartDate; i < SeriesEndDate; i = i.AddMonths(Monthly))
//{
// months.Add(new BusinessWeekDays { Tuesday = dt, Monday = dt.AddDays(7) });
// Console.WriteLine(months);
//}
}
Reply
Answers (
1
)
teltonika fmb920
Delete text from rectangle area from PDF using ITEXTSHARP