System::DateTime::Subtract 方法

DateTime::Subtract(DateTime) const method

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

TimeSpan System::DateTime::Subtract(DateTime value) const
ParameterType描述
valueDateTime一个 DateTime 类的实例,标记要计算的区间的一端。

ReturnValue

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

另见

DateTime::Subtract(TimeSpan) const method

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

DateTime System::DateTime::Subtract(TimeSpan duration) const
ParameterType描述
durationTimeSpan要减去的时间间隔

ReturnValue

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

另见