System::DateTime::Subtract 方法

DateTime::Subtract(DateTime) const method

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

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

ReturnValue

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

另见

DateTime::Subtract(TimeSpan) const method

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

DateTime System::DateTime::Subtract(TimeSpan duration) const
参数类型描述
durationTimeSpan要减去的时间间隔

ReturnValue

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

另见