Oh, the time here is actually a DateTime example, but because the time of the datetime identifies is from the year and month until milliseconds. If it is simply used with DateTime.Compare (DateTime DT1, DateTime DT2), it is very uncomfortable. Internet query saw some netizens said that I can use the Datediff function, but I didn't find this function in the class browser. Because I just want to stay in the HH: MM stage, it is estimated that the way to use it is also very big, and I just write myself.
:
Public bool checktime ()
{
String strChecktime; // From the string from the definition time, HH: MM form
DateTime dtpara1 = convert.todatetime (strChecktime);
DateTime dtpara2 = convert.todatetime ("10:30");
Int IntCompare = datetime.compare (dtpara1, dtpara2);
IF (intcompare> = 0)
{
Return True;
}
Else
{
Return False;
} // Because you only use two choices, it defines the BOOL type.
}
Oh, it is actually a very simple function, the most important thing to use the function of DateTime.comPare (DateTime DT1, dateTime DT2). But at least, I also explain myself.