System::DateTime::operator- 方法

DateTime::operator-(DateTime) const method

返回一个 TimeSpan 类的实例,表示当前对象和指定对象所表示的日期时间值之间的时间间隔。

TimeSpan System::DateTime::operator-(DateTime value) const
参数类型描述
valueDateTime一个 DateTime 类实例,标记要计算的区间的一端

ReturnValue

一个 TimeSpan 类实例,表示当前对象和 value 所表示的日期和时间值之间的时间间隔。

另见

DateTime::operator-(TimeSpan) const method

返回一个新的 DateTime 类实例,表示日期和时间值,该值是从当前对象所表示的值中减去指定时间跨度后的结果。

DateTime System::DateTime::operator-(TimeSpan value) const
参数类型描述
TimeSpan要减去的时间间隔

ReturnValue

一个新的 DateTime 类实例,表示从当前对象表示的值减去 value 后得到的日期和时间值。

另见