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



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

Parameters

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

Return Value

A TdTimestampWithTimeZone is returned that is the result of subtracting the TimeSpan from the TdTimestampWithTimeZone.
Exceptions
ExceptionDescription
The result could not be represented as a TdTimestampWithTimeZone.
Remarks

If the timestamp is Null a TdTimestampWithTimeZone.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

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

results in a TdTimestampWithTimeZone value of "2008-10-10 12:46:30.2122+08:00".

A TimeSpan can have a scale up to 7. A TdTimestampWithTimeZone 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 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdTimestampWithTimeZone Structure
TdTimestampWithTimeZone Members
Overload List