shreyas adikumar

shreyas adikumar

  • NA
  • 53
  • 5.1k

coming out of loop even after time is matching in asp.net

Oct 1 2018 2:10 AM
hi it is not matching the given time with present time it is coming outside the loop even  after matching time also it is giving false even when the time is matching can u please suggest me where i am going wrong.
string minute = "15";
string minute2 = "20";
string minute3 = "27";
string minute4 = "02";
TimeSpan first = TimeSpan.Parse(minute);
TimeSpan second = TimeSpan.Parse(minute2);
TimeSpan Third = TimeSpan.Parse(minute3);
TimeSpan fourth = TimeSpan.Parse(minute4);
TimeSpan now = DateTime.Now.TimeOfDay;
if (now == first|| now == second || now == Third || now == fourth)
{
//matched
}
else
{
}
}

Answers (3)