System.DateTimeOffset.Equals Method

Determines whether two specified DateTimeOffset objects represent the same point in time.

Syntax

public static bool Equals (DateTimeOffset first, DateTimeOffset second)

Parameters

first
The first object to compare.
second
The second object to compare.

Returns

true if the two DateTimeOffset objects have the same DateTimeOffset.UtcDateTime value; otherwise, false.

Remarks

Before it performs the comparison, this method converts both DateTimeOffset objects to Coordinated Universal Time (UTC). The method is equivalent to the following:

code reference: System.DateTimeOffset.Syntax#4

In other words, the DateTimeOffset.Equals(DateTimeOffset, DateTimeOffset) method determines whether the two DateTimeOffset objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two DateTimeOffset objects represent the same time and have the same offset value, use the DateTimeOffset.EqualsExact(DateTimeOffset) method.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0