Send feedback on this topic.
Teradata.Client.Provider
Equals(TdTimeWithTimeZone,TdTimeWithTimeZone) Method
Example 



Teradata.Client.Provider Namespace > TdTimeWithTimeZone Structure > Equals Method : Equals(TdTimeWithTimeZone,TdTimeWithTimeZone) Method
A TdTimeWithTimeZone instance.
A TdTimeWithTimeZone instance.
Compares two TdTimeWithTimeZone instances to determine whether they are equal.
Syntax
'Declaration
 
Public Overloads Shared Function Equals( _
   ByVal left As TdTimeWithTimeZone, _
   ByVal right As TdTimeWithTimeZone _
) As Boolean
'Usage
 
Dim left As TdTimeWithTimeZone
Dim right As TdTimeWithTimeZone
Dim value As Boolean
 
value = TdTimeWithTimeZone.Equals(left, right)
public static bool Equals( 
   TdTimeWithTimeZone left,
   TdTimeWithTimeZone right
)
public:
static bool Equals( 
   TdTimeWithTimeZone left,
   TdTimeWithTimeZone right
) 

Parameters

left
A TdTimeWithTimeZone instance.
right
A TdTimeWithTimeZone instance.

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 TdTimeWithTimeZone.Null

-or-

left is equal to right.

false

left or right is Null

-or-

left is not equal to right.

When comparing two time values the UTC offset is also included in the comparison. The UTC offset is subtracted from the time which results in the UTC time. The following table shows the result when comparing two TdTimeWtihTimeZone values:

Equals Comparison Result
"23:10:11+05:00" Equals "15:00:02-02:00" false
"23:10:11+01:00" Equals "21:10:11-01:00" true
"21:53:00-08:00" Equals "21:53:00-06:00" false
"21:53:00-08:00" Equals "05:53:00+00:00" true

Example
The following code example uses various comparison methods and operators.
TdTimeWithTimeZone  later = new TdTimeWithTimeZone(new TimeSpan(15, 45, 0), new TimeSpan(-4, 0, 0));
TdTimeWithTimeZone earlier = new TdTimeWithTimeZone(new TimeSpan(14, 30, 0), new TimeSpan(-3, 0, 0));
 
// The following comparison methods and operators are equivalent
if (false == TdTimeWithTimeZone.Equals(later, earlier) ||
    later != earlier ||
    true == TdTimeWithTimeZone.NotEquals(later, earlier) )
{
   Console.WriteLine(“later does not equal earlier”);
}
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdTimeWithTimeZone Structure
TdTimeWithTimeZone Members
Overload List