Send feedback on this topic.
Teradata.Client.Provider
Subtraction(TdDate,TimeSpan) Operator



Teradata.Client.Provider Namespace > TdDate Structure > Subtraction Operator : Subtraction(TdDate,TimeSpan) Operator
A TdDate.
A TimeSpan that will be subtracted from the TdDate
Subtracts the specified TimeSpan from a TdDate.
Syntax
'Declaration
 
Overloads Public Operator -( _
   ByVal date As TdDate, _
   ByVal timeSpan As TimeSpan _
) As TdDate
'Usage
 
public TdDate operator -( 
   TdDate date,
   TimeSpan timeSpan
)
public:
TdDate operator -( 
   TdDate date,
   TimeSpan timeSpan
)

Parameters

date
A TdDate.
timeSpan
A TimeSpan that will be subtracted from the TdDate

Return Value

A TdDate is returned that is the result of subtracting the TimeSpan from the TdDate.
Exceptions
ExceptionDescription
Unable to subtract the TimeSpan from the TdDate.
Remarks

If the date parameter is Null a TdDate.Null will be returned.

The only component of the TimeSpan object that will be considered is the day component. When this operation is performed, the day component of the TimeSpan is subtracted from the this instance of TdDate. For example, if the date is "2007-10-04" and TimeSpan is "0.02:00:00.00" (0 days, 2 hours) the subtract operation will result in "2007-10-04".

The number of days will be calculated from the components that were specified when TimeSpan was initialized. Therefore, if a TimeSpan was initialized as new TimeSpan(47, 60, 20) (47 hours, 60 minutes, 20 seconds), the number of days that will be subtracted from TdDate will be 2.

Requirements

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

See Also

Reference

TdDate Structure
TdDate Members
Overload List