Struct DateOnly
Represents a calendar date within the range 0001-01-01 to 9999-12-31, with no time component.
Namespace: Esri.ArcGISRuntime
Assembly: Esri.ArcGISRuntime.dll
Syntax
public readonly struct DateOnly : IComparable, IComparable<DateOnly>, IEquatable<DateOnly>
Remarks
This type is a compatibility shim for System.DateOnly
for projects targeting .NET Framework and UWP.
For projects targeting .NET 8.0 or newer, use the system type instead.
Constructors
Name | Description |
---|---|
DateOnly(Int32, Int32, Int32) | Initializes a new instance of the DateOnly struct with the specified year, month, and day. |
Properties
Name | Description |
---|---|
Day | Gets the day component of the date. |
MaxValue | Gets the largest possible value of DateOnly (9999-12-31). |
MinValue | Gets the smallest possible value of DateOnly (0001-01-01). |
Month | Gets the month component of the date. |
Year | Gets the year component of the date. |
Methods
Name | Description |
---|---|
CompareTo(DateOnly) | |
CompareTo(Object) | |
Equals(DateOnly) | |
Equals(Object) | |
FromDateTime(DateTime) | Converts System.DateTime to |
GetHashCode() | |
Parse(String) | Creates a new DateOnly struct that represents the given ISO 8601 date string (YYYY-MM-DD). |
ToDateTime(TimeOnly) | Converts this |
ToString() |
Operators
Name | Description |
---|---|
Equality(DateOnly, DateOnly) | Checks if two DateOnly instances are equal. |
GreaterThan(DateOnly, DateOnly) | Checks if left DateOnly instance is greater than the right one. |
GreaterThanOrEqual(DateOnly, DateOnly) | Checks if left DateOnly instance is greater than or equal to the right one. |
Inequality(DateOnly, DateOnly) | Checks if two DateOnly instances are not equal. |
LessThan(DateOnly, DateOnly) | Checks if left DateOnly instance is less than the right one. |
LessThanOrEqual(DateOnly, DateOnly) | Checks if left DateOnly instance is less than or equal to the right one. |
Applies to
Target | Versions |
---|---|
.NET Framework | 200.4 - 200.6 |
UWP | 200.4 - 200.6 |