Send feedback on this topic.
Teradata.Client.Provider
Equality Operator (TdTimestampWithTimeZone)
Example 



Teradata.Client.Provider Namespace > TdTimestampWithTimeZone Structure : Equality Operator
An instance of TdTimestampWithTimeZone.
An instance of TdTimestampWithTimeZone.
Compares two TdTimestampWithTimeZones to determine whether the left operand is equal to the right operand.
Syntax
'Declaration
 
Public Operator =( _
   ByVal left As TdTimestampWithTimeZone, _
   ByVal right As TdTimestampWithTimeZone _
) As Boolean
'Usage
 
public bool operator ==( 
   TdTimestampWithTimeZone left,
   TdTimestampWithTimeZone right
)
public:
bool operator ==( 
   TdTimestampWithTimeZone left,
   TdTimestampWithTimeZone right
)

Parameters

left
An instance of TdTimestampWithTimeZone.
right
An instance of TdTimestampWithTimeZone.

Return Value

A boolean is returned that indicates the result of the comparison.
Remarks

The value returned is true if the left is equal to the right, false otherwise.

Return Value Description
true

left and right are TdTimestampWithTimeZone.Null

-or-

left is equal to right.

false

left or right is Null

-or-

left is not equal to right.

Unlike comparison operators, Equality operators do not always return false when left and right operands are Null. Therefore the reverse condition can be considered true. TdTimestampWithTimeZone implementation is very similar to the Nullable class in this regard.

For more information on how the comparison is performed refer to TdTimestampWithTimeZone.CompareTo.

Example
Following example shows that the Equality operator can safely be used in an if statement.
TdTimestampWithTimeZone x = TdTimestampWithTimeZone.Null;
TdTimestampWithTimeZone y = TdTimestampWithTimeZone.MinValue;
            
if (x == y)
{
    // x is equal to y.
    Console.WriteLine(@"X is equal to Y").
}
else
{
    // x is not equal y
    Console.WriteLine(@"X is not equal to Y").
}
            
y = TdTimestampWithTimeZone.Null;
            
if (x == y)
{
    // x is equal to y.
    Console.WriteLine(@"X is equal to Y").
}
else
{
    // x is not equal y
    Console.WriteLine(@"X is not equal to Y").
}
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

TdTimestampWithTimeZone Structure
TdTimestampWithTimeZone Members