Can anybody tell me how I can make a solution for this statement
I have some code which must be executed every two weeks
Starting from
DateTime between 12:00:00 midnight, February 17, 2013 to 11:59:59 P.M., February 25, 2013
and nexttime
DateTime between 12:00:00 midnight, March 4, 2013 to 11:59:59 P.M., March 11, 2013
jylland
Member
44 Points
48 Posts
Loop datetime / weeks
Feb 09, 2013 10:11 PM|LINK
hi
Can anybody tell me how I can make a solution for this statement
I have some code which must be executed every two weeks
Starting from
DateTime between 12:00:00 midnight, February 17, 2013 to 11:59:59 P.M., February 25, 2013
and nexttime
DateTime between 12:00:00 midnight, March 4, 2013 to 11:59:59 P.M., March 11, 2013
and further into the infinite
oned_gk
All-Star
31511 Points
6431 Posts
Re: Loop datetime / weeks
Feb 09, 2013 11:27 PM|LINK
jylland
Member
44 Points
48 Posts
Re: Loop datetime / weeks
Feb 10, 2013 09:18 AM|LINK
I have a gridview I will use every 2 nd weeks
oned_gk
All-Star
31511 Points
6431 Posts
Re: Loop datetime / weeks
Feb 10, 2013 09:53 AM|LINK
protected void Page_Load(object sender, EventArgs e) { DateTime startdate = new DateTime(2013, 2,17); DateTime todaydate = DateTime.Now.Date; TimeSpan t = todaydate-startdate; int days = (int)t.TotalDays; if (days % 14 == 0) { //show gridview } }jylland
Member
44 Points
48 Posts
Re: Loop datetime / weeks
Feb 10, 2013 11:00 AM|LINK
Thanks very much, I will try this statement later today, I will went back here to tell my succes or not succes.
It was a success, but it should run 7 days then 7 days where it not run and again 7 days
I do this
if ((days % 14 <= 7) && (days % 14 > -1))