hi, I am trying with comparing time with current time using if statement output is going wrong can I know what is the problem.
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
{
}
}
can I please know where I went wrong.
Mageshwaran RPosted Nov 14, 2019, 11:56 AM
shreyas adikumarPosted Oct 1, 2018, 2:01 AM
shreyas adikumarPosted Oct 1, 2018, 12:16 AM
Rafnas T PPosted Sep 28, 2018, 7:52 AM
Rupesh KahanePosted Sep 28, 2018, 6:43 AM
Gautam ParmarPosted Sep 28, 2018, 3:59 AM