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



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

Parameters

timestamp
A TdTimestamp.
span
A TimeSpan that will be subtracted from the TdTimestamp

Return Value

A TdTimestamp is returned that is the result of subtracting the TimeSpan from the TdTimestamp.
Exceptions
ExceptionDescription
Unable to subtract the specified TimeSpan from the TdTimestamp.
Remarks
If timestamp is Null a TdTimestamp.Null will be returned.

If the scale between the timestamp and the span parameters 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
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdTimestamp Structure
TdTimestamp Members
Overload List