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



Teradata.Client.Provider Namespace > TdTimestamp Structure > Subtract Method : Subtract(TimeSpan) Method
The TimeSpan that will be subtracted.
The specified TimeSpan will be subtracted from this instance of TdTimestamp.
Syntax
'Declaration
 
Public Overloads Function Subtract( _
   ByVal timeSpan As TimeSpan _
) As TdTimestamp
'Usage
 
Dim instance As TdTimestamp
Dim timeSpan As TimeSpan
Dim value As TdTimestamp
 
value = instance.Subtract(timeSpan)
public TdTimestamp Subtract( 
   TimeSpan timeSpan
)
public:
TdTimestamp Subtract( 
   TimeSpan timeSpan
) 

Parameters

timeSpan
The TimeSpan that will be subtracted.

Return Value

A TdTimestamp is returned that is the result of the TimeSpan subtracted from this instance of TdTimestamp.
Exceptions
ExceptionDescription
Unable to subtract the specified TimeSpan from this instance of TdTimestamp.
Remarks

If this instance of TdTimestamp is Null a TdTimestamp.Null will be returned.

The TimeSpan object can contain data about the number of days, hours, minutes, seconds, and fractional seconds.

If the scale between this instance of TdTimestamp and the timeSpan parameter are different the arithmetic operation will be performed using the different scales. The result will then be truncated to match the scale of the timestamp. For example, the addition operation

TdTimestamp.Parse("2008-10-10 12:48:53.2123") - TimeSpan.Parse("00:02:03.000099")

results in a TdTimestamp value of "2008-10-10 12:46:30.2122".

A TimeSpan can have a scale up to 7. A TdTimestamp has a maximum scale of 6. When performing an arithmetic operation, only the first 6 digits to the right of the decimal point of the TimeSpan operand will be considered. The 7th digit will be ignored.

Requirements

Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also

Reference

TdTimestamp Structure
TdTimestamp Members
Overload List