i wish to compare to datetime values just by date, not by hour. How can i do so ?
I want to remove some values that are outside an interval selected by me :
if (DateTime.Compare(DateTime.Parse(t.Rows[i][1].ToString().Trim()), dateTimePicker1.Value) < 0 || DateTime.Compare(DateTime.Parse(t.Rows[i][1].ToString().Trim()), dateTimePicker2.Value) > 0)
/*remove comand*/
Use the
DateTime.Dateproperty for this, since this contains only the date part of theDateTimeobject.Do not forget to check about the UTC or timestamp value if exists.