Class LocalDate
Represents a date value, without a time zone and time related components
public sealed class LocalDate : TemporalValue, IConvertible, IEquatable<LocalDate>, IComparable, IComparable<LocalDate>
- Inheritance
-
LocalDate
- Implements
- Inherited Members
- Extension Methods
Constructors
- LocalDate(DateOnly)
Initializes a new instance of LocalDate from a date value
- LocalDate(DateTime)
Initializes a new instance of LocalDate from a date value
- LocalDate(int, int, int)
Initializes a new instance of LocalDate from individual date component values
Fields
Properties
- Day
Gets the day of month component of this instance.
- Month
Gets the month component of this instance.
- Year
Gets the year component of this instance.
Methods
- CompareTo(LocalDate)
Compares the value of this instance to a specified LocalDate value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
- CompareTo(object)
Compares the value of this instance to a specified object which is expected to be a LocalDate value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified LocalDate value.
- ConvertToDateTime()
Converts this TemporalValue instance to a DateTime instance.
- Equals(LocalDate)
Returns a value indicating whether the value of this instance is equal to the value of the specified LocalDate instance.
- Equals(object)
Returns a value indicating whether this instance is equal to a specified object.
- GetHashCode()
Returns the hash code for this instance.
- ToDateOnly()
Converts this date value to a DateOnly instance.
- ToDateTime()
Converts this date value to a DateTime instance.
- ToString()
Converts the value of the current LocalDate object to its equivalent string representation.
Operators
- operator >(LocalDate, LocalDate)
Determines whether one specified LocalDate is later than another specified LocalDate.
- operator >=(LocalDate, LocalDate)
Determines whether one specified LocalDate represents a duration that is the same as or earlier than the other specified LocalDate
- operator <(LocalDate, LocalDate)
Determines whether one specified LocalDate is earlier than another specified LocalDate.
- operator <=(LocalDate, LocalDate)
Determines whether one specified LocalDate represents a duration that is the same as or later than the other specified LocalDate