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?
Loading
JurePosted Nov 4, 2010, 7:56 PM
string cell_example = "21.10.2010 01:48:00";
DateTime date = DateTime.Parse(cell_example);
yokzuPosted Nov 4, 2010, 8:01 PM
yokzuPosted Nov 4, 2010, 7:48 PM
21.10.2010 01:48:00
How can i transfer this cell's value to a variable? Should i use a datetime variable?
JurePosted Nov 4, 2010, 7:44 PM
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)?