G
Guest
Im having difficulty coming up with a good algorithm to express the following
comparison:
"if <a given date> falls between the (current date - 5 days) and the
(current date)"
Obviously. DateTime.Now and something like (AddDays(DateTime.Now,-5) are used
for the inner and outer ranges, its how to express the "between" that has me.
/* what Id like to do, in pseudo code */
dateToTest=DateTime.Parse("mm/dd/yy");
maxDate=DateTime.Now;
minDate=DateTime.Now.AddDays(-5);
bool b1=IsBetween(minDate,maxDate,dateToTest);
Thanks, Mark
comparison:
"if <a given date> falls between the (current date - 5 days) and the
(current date)"
Obviously. DateTime.Now and something like (AddDays(DateTime.Now,-5) are used
for the inner and outer ranges, its how to express the "between" that has me.
/* what Id like to do, in pseudo code */
dateToTest=DateTime.Parse("mm/dd/yy");
maxDate=DateTime.Now;
minDate=DateTime.Now.AddDays(-5);
bool b1=IsBetween(minDate,maxDate,dateToTest);
Thanks, Mark