Trying to compare a given Time between two times to see if it\'s within the those intervals. e.g. if given Time is 00:00 I need to find out if it falls between 21:00:00 to
string dt=DateTime.Now.ToShortTimeString();
DateTime presenttime=Convert.ToDateTime(dt);
starttime = starttimepicker.ValueString;
DateTime dtime=Convert.ToDateTime(starttime);
if (dtime > presenttime)
{
MessageBox.Show("Time cannot be greater than System Time. Please Try Again!", "Do not selecting future time", MessageBoxButton.OK);
starttimepicker.Value = presenttime;
}