Send feedback on this topic.
Teradata.Client.Provider
Subtract(TdIntervalDayToSecond) Method



Teradata.Client.Provider Namespace > TdPeriodTime Structure > Subtract Method : Subtract(TdIntervalDayToSecond) Method
The TdIntervalDayToSecond interval will be subtracted from this instance of TdPeriodTime.
Subtracts the specified TdIntervalDayToSecond from this instance of TdPeriodTime.
Syntax
'Declaration
 
Public Overloads Function Subtract( _
   ByVal interval As TdIntervalDayToSecond _
) As TdPeriodTime
'Usage
 
Dim instance As TdPeriodTime
Dim interval As TdIntervalDayToSecond
Dim value As TdPeriodTime
 
value = instance.Subtract(interval)
public TdPeriodTime Subtract( 
   TdIntervalDayToSecond interval
)
public:
TdPeriodTime Subtract( 
   TdIntervalDayToSecond interval
) 

Parameters

interval
The TdIntervalDayToSecond interval will be subtracted from this instance of TdPeriodTime.

Return Value

A TdPeriodTime is returned that is the result of subtracting the TdIntervalDayToSecond from this instance of TdPeriodTime.
Exceptions
ExceptionDescription
Unable to subtract the specified TdIntervalDayToSecond from this instance of TdPeriodTime.
Remarks

If this instance of TdPeriodTime or the interval is Null a TdPeriodTime.Null will be returned.

When this operation is performed, the day component of the interval is ignored. Only the hour, minute, and second components are used in this operation. For example, if the period is "05:00:00, 06:30:00" and the interval is "1 02:00:00.00" (1 day, 2 hours) the subtract operation will result in a period of "03:00:00, 04:30:00".

When subtracting a interval from a TdPeriodTime it is possible that the ending bound will roll into the next 24 hours, or the beginning bound will roll into the previous 24 hours. For example, suppose the period is:

   (19:32:32.3404, 22:00:00.3232)

Subtracting the interval of "0 20:00:00" (20 hours) from the period will cause the beginning bound to roll back into the previous 24 hours which results in the invalid period:

    (23:32:32.3404, 02:00:00.3232)

Subtracting the interval of "-0 03:00:00" (-3 hours) from the period will cause the ending bound to roll into the next 24 hours which will result in the invalid period:

    (22:32:32.3404, 01:00:00.3232)
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdPeriodTime Structure
TdPeriodTime Members
Overload List