|
Op_subtraction |
Overloaded. Subtract the specified datetime or timespan from the specified datetime. |
I was confused when I saw the above content. How should I find the difference between the two time scales? Click the link to view the following content:
Subtract the specified datetime or timespan from the specified datetime.
Reload list
Name |
Description |
Datetime. op_subtraction (datetime, datetime) |
Subtract the specified date and time from one specified date and time to generate the time interval. Supported by. NET Compact framework. |
Datetime. op_subtraction (datetime, timespan) |
Subtract the specified time interval from the specified date and time to generate a new date and time. Supported by. NET Compact framework. |
I am confused. After thinking for several days, I finally found out, why not use the minus sign directly?
Therefore, the following program uses a minus sign to get the difference between two time scales. The result is timespan. Timespan timespan1 = datetime. Now-time2;
Labeltimereal. Text = timespan2second (timespan1). tostring ();
I hope others will not make this mistake! Hey