اقرأ باللغة الإنجليزية تحرير

مشاركة عبر


DateOnly.CompareTo Method

Definition

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.

Overloads

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.

CompareTo(DateOnly)

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

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.

public int CompareTo(DateOnly value);

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 10 والإصدارات الأخرى
منتج الإصدارات
.NET 6, 7, 8, 9, 10

CompareTo(Object)

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

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.

public int CompareTo(object? value);

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 10 والإصدارات الأخرى
منتج الإصدارات
.NET 6, 7, 8, 9, 10