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



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

Parameters

left
An instance of TdTime.
right
An instance of TdTime.

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 TdTime.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. TdTime implementation is very similar to the Nullable class in this regard.

Refer to TdTime.Equals for further information on this equality operator.

Example
Following example shows that the Equality operator can safely be used in an if statement.
TdTime x = TdTime.Null;
TdTime y = TdTime.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 = TdTime.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

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

TdTime Structure
TdTime Members