DateTimeSubtraction Operator (DateTime, DateTime) |
Subtracts a specified date and time from another specified date and time and returns a time interval.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static TimeSpan operator -(
DateTime d1,
DateTime d2
)
Parameters
- d1
- Type: SystemDateTime
The date and time value to subtract from (the minuend). - d2
- Type: SystemDateTime
The date and time value to subtract (the subtrahend).
Return Value
Type:
TimeSpanThe time interval between
d1 and
d2; that is,
d1 minus
d2.
See Also