User2113851930 posted
How do I put hours in this code, I want a specific Clock to be incorporated in my code, so the shift is on days and at a given clock,
instead of at midnight as in my code below
ect. wednesday 2 february 11 O'Clock to 9 february 11 O'Clock
(As you can see in my code it happen again and again every third weeks)
DateTime startdate = new DateTime(2013, 2 , 12, 11, 00, 0);
DateTime todaydate = DateTime.Now.Date;
TimeSpan t = todaydate - startdate;
int days = (int)t.TotalDays;
if ((days % 21 <= 6) && (days % 21 > -1)) {
something happens...
}
I can explain it better.
As you can see in my code my start date is (2013, 2, 12) 11 O'clock.
As you can see the code shift every third weeks "if ((days % 21 <= 6) && (days % 21 > -1))". "7 days
act"
What I want is that it shift exactly on 11 O'clock.
Example: start (2013, 2 , 12, 11, 00, 0) and end at (2013, 9 , 12, 10, 59, 59), as you can see exactly 7days span