date-time control......time validations

  • Thread starter Thread starter Anil
  • Start date Start date
A

Anil

i am using 2 datetime picker controls for showing fromtime and totime.Now i
want to check the fromtime should not be greater than totime validations
with AM and PM checking also.how can i perform this in C# windows forms ?
Please help.
 
HI,

You can use
if (fromTime.Value < totime.Value)
{
// your logic
}

Regards
Vipul Patel
Microsoft India Community Star
 
Hi,
i am using 2 datetime picker controls for showing fromtime and totime.Now i
want to check the fromtime should not be greater than totime validations
with AM and PM checking also.how can i perform this in C# windows forms ?
Please help.

I can recomand You to use MinDate and MaxDate properties to keep those
dates in right order. Besides, DateTime is *comparable* so you should
compare two values without any problem.

Regards

Marcin
 
Back
Top