DateOnly.CompareTo Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
CompareTo(DateOnly) |
Compares the value of this instance to a specified DateOnly value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateOnly value. |
CompareTo(Object) |
Compares the value of this instance to a specified object that contains a specified DateOnly value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateOnly value. |
- Source:
- DateOnly.cs
- Source:
- DateOnly.cs
- Source:
- DateOnly.cs
public:
virtual int CompareTo(DateOnly value);
public int CompareTo (DateOnly value);
abstract member CompareTo : DateOnly -> int
override this.CompareTo : DateOnly -> int
Public Function CompareTo (value As DateOnly) As Integer
Parameters
- value
- DateOnly
The object to compare to the current instance.
Returns
Less than zero if this instance is earlier than value. Greater than zero if this instance is later than value. Zero if this instance is the same as value.
Implements
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | 6, 7, 8, 9 |
- Source:
- DateOnly.cs
- Source:
- DateOnly.cs
- Source:
- DateOnly.cs
public:
virtual int CompareTo(System::Object ^ value);
public int CompareTo (object? value);
abstract member CompareTo : obj -> int
override this.CompareTo : obj -> int
Public Function CompareTo (value As Object) As Integer
Parameters
- value
- Object
A boxed object to compare, or null
.
Returns
Less than zero if this instance is earlier than value. Greater than zero if this instance is later than value. Zero if this instance is the same as value.
Implements
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: