Hi,
I wanna control a date value from a cell (in an excel file) and is this date between 2 of them or not? I mean there are 3 cells and all of them's format a date value. I want to know the first value is between of the another 2 cell's value? I've never been work with date values so i dont know so much. How can i do that?
Date control
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

JureRank #2,128 · 670 reputationPosted Nov 4, 2010, 3:56 PM EDT
string cell_example = "21.10.2010 01:48:00";
DateTime date = DateTime.Parse(cell_example);
JureRank #2,128 · 670 reputationPosted Nov 4, 2010, 3:44 PM EDT
bool IsBetween2Dates(DateTime date, DateTime start, DateTime end)
{
return date > start && date < end;
}
If you need inclusive checking, replace "< "and ">" with "<=" and ">=".
How are dates written in cells (i.e. "dd/mm/yyyy" or "mm-dd-yy", etc)?
yokzuRank #5,421 · 300 reputationPosted Nov 4, 2010, 3:48 PM EDT
21.10.2010 01:48:00
How can i transfer this cell's value to a variable? Should i use a datetime variable?
yokzuRank #5,421 · 300 reputationPosted Nov 4, 2010, 4:01 PM EDT