Send feedback on this topic.
Teradata.Client.Provider
CompareTo(TdTimestampWithTimeZone) Method



Teradata.Client.Provider Namespace > TdTimestampWithTimeZone Structure > CompareTo Method : CompareTo(TdTimestampWithTimeZone) Method
The TdTimestampWithTimeZone to compare against.
Compares this instance to the specified TdTimestampWithTimeZone other.
Syntax
'Declaration
 
Public Overloads Function CompareTo( _
   ByVal other As TdTimestampWithTimeZone _
) As Integer
'Usage
 
Dim instance As TdTimestampWithTimeZone
Dim other As TdTimestampWithTimeZone
Dim value As Integer
 
value = instance.CompareTo(other)
public int CompareTo( 
   TdTimestampWithTimeZone other
)
public:
int CompareTo( 
   TdTimestampWithTimeZone other
) 

Parameters

other
The TdTimestampWithTimeZone to compare against.

Return Value

The result of the comparison is returned as an integer.
Remarks

The integer returned when this instance is compared to other indicates the following:

Return Value Meaning
Less than Zero

This instance is less than other.

-or-

This instance is TdTimestampWithTimeZone.Null.

Zero

This instance is equal to other.

-or-

This instance is Null and value is Null.

Greater than Zero

This instance is greater than other.

-or-

other is Null.

When a comparison is performed between TdTimestampWithTimeZone values, the UTC offset is taken into account. The UTC offset is subtracted from the time which results in the UTC Time. It is possible that a value can roll into the next or previous day. If this should occur the date component will either increase to the next day or decrease to the previous day. The following table shows the result of several comparisons between TdTimestampWithTimeZone values:

Comparison Result
"2007-10-10 12:21:00+01:01" compare to "2007-10-10 09:11:00-02:10" 0 -- the values are equal.
"2007-01-21 20:21:00-04:00" compare to "2007-01-21 09:11:00+02:10" 1 -- the left operand is greater than the right.
"2007-04-11 01:54:00+03:00" compare to "2007-04-11 19:11:00-01:00" -1 -- the left operand is less than the right.
"2007-04-11 00:30:00+03:00" compare to "2007-04-10 20:30:00-01:00" 0 -- the values are equal.

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