G
Guest
Hello Everyone,
How can I compare time in C#.
I have to write that if the current time is less than 9:30 am then exit the
program.
How can i do this programmatically. Right now I am trying to do the code
below, but it doen't work
DateTime dtTime = DateTime.Now;
DateTime timeLimit = new DateTime(dtTime.Year,dtTime.Month, dtTime.Day,
9,30,0);
if ( dtTime < timeLimit)
return;
else
{
}
Thanks.
How can I compare time in C#.
I have to write that if the current time is less than 9:30 am then exit the
program.
How can i do this programmatically. Right now I am trying to do the code
below, but it doen't work
DateTime dtTime = DateTime.Now;
DateTime timeLimit = new DateTime(dtTime.Year,dtTime.Month, dtTime.Day,
9,30,0);
if ( dtTime < timeLimit)
return;
else
{
}
Thanks.