[This is preliminary documentation and is subject to change.]

C# | Visual Basic | Visual C++ |
public struct LocalDate : IEquatable<LocalDate>, IComparable<LocalDate>, IComparable, IFormattable, IXmlSerializable
Public Structure LocalDate _ Implements IEquatable(Of LocalDate), IComparable(Of LocalDate), _ IComparable, IFormattable, IXmlSerializable
public value class LocalDate : IEquatable<LocalDate>, IComparable<LocalDate>, IComparable, IFormattable, IXmlSerializable

All Members | Constructors | Methods | Properties | ||
Icon | Member | Description |
---|---|---|
![]() | LocalDate(Int32, Int32, Int32) |
Constructs an instance for the given year, month and day in the ISO calendar.
|
![]() | LocalDate(Int32, Int32, Int32, CalendarSystem) |
Constructs an instance for the given year, month and day in the specified calendar.
|
![]() | LocalDate(Era, Int32, Int32, Int32) |
Constructs an instance for the given era, year of era, month and day in the ISO calendar.
|
![]() | LocalDate(Era, Int32, Int32, Int32, CalendarSystem) |
Constructs an instance for the given era, year of era, month and day in the specified calendar.
|
![]() ![]() | Add(LocalDate, Period) |
Adds the specified period to the date. Friendly alternative to operator+().
|
![]() ![]() | Addition(LocalDate, Period) |
Adds the specified period to the date.
|
![]() ![]() | Addition(LocalDate, LocalTime) | |
![]() | AtMidnight()()()() |
Gets a LocalDateTime at midnight on the date represented by this local date.
|
![]() | Calendar | Gets the calendar system associated with this local date. |
![]() | CompareTo(LocalDate) |
Indicates whether this date is earlier, later or the same as another one.
|
![]() | Day | Gets the day of this local date within the month. |
![]() | DayOfWeek |
Gets the week day of this local date as a number.
|
![]() | DayOfYear | Gets the day of this local date within the year. |
![]() ![]() | Equality(LocalDate, LocalDate) |
Compares two LocalDate values for equality. This requires
that the dates be the same, within the same calendar.
|
![]() | Equals(Object) |
Compares two LocalDate values for equality. This requires
that the dates be the same, within the same calendar.
(Overrides ValueType.Equals(Object).) |
![]() | Equals(LocalDate) |
Compares two LocalDate values for equality. This requires
that the dates be the same, within the same calendar.
|
![]() | Era | Gets the era of this local date. |
![]() ![]() | FromWeekYearWeekAndDay(Int32, Int32, IsoDayOfWeek) |
Returns the local date corresponding to the given "week year", "week of week year", and "day of week"
in the ISO calendar system.
|
![]() | GetHashCode()()()() |
Returns a hash code for this local date.
(Overrides ValueType.GetHashCode()()()().) |
![]() ![]() | GreaterThan(LocalDate, LocalDate) |
Compares two LocalDate values to see if the left one is strictly later than the right
one.
|
![]() ![]() | GreaterThanOrEqual(LocalDate, LocalDate) |
Compares two LocalDate values to see if the left one is later than or equal to the right
one.
|
![]() ![]() | Inequality(LocalDate, LocalDate) |
Compares two LocalDate values for inequality.
|
![]() | IsoDayOfWeek |
Gets the week day of this local date expressed as an IsoDayOfWeek value,
for calendars which use ISO days of the week.
|
![]() ![]() | LessThan(LocalDate, LocalDate) |
Compares two LocalDate values to see if the left one is strictly earlier than the right
one.
|
![]() ![]() | LessThanOrEqual(LocalDate, LocalDate) |
Compares two LocalDate values to see if the left one is earlier than or equal to the right
one.
|
![]() | Minus(Period) |
Subtracts the specified period from this date. Fluent alternative to operator-().
|
![]() | Month | Gets the month of this local date within the year. |
![]() | Next(IsoDayOfWeek) |
Returns the next LocalDate falling on the specified IsoDayOfWeek.
This is a strict "next" - if this date on already falls on the target
day of the week, the returned value will be a week later.
|
![]() | Plus(Period) |
Adds the specified period to this date. Fluent alternative to operator+().
|
![]() | PlusDays(Int32) |
Returns a new LocalDate representing the current value with the given number of days added.
|
![]() | PlusMonths(Int32) |
Returns a new LocalDate representing the current value with the given number of months added.
|
![]() | PlusWeeks(Int32) |
Returns a new LocalDate representing the current value with the given number of weeks added.
|
![]() | PlusYears(Int32) |
Returns a new LocalDate representing the current value with the given number of years added.
|
![]() | Previous(IsoDayOfWeek) |
Returns the previous LocalDate falling on the specified IsoDayOfWeek.
This is a strict "previous" - if this date on already falls on the target
day of the week, the returned value will be a week earlier.
|
![]() ![]() | Subtract(LocalDate, Period) |
Subtracts the specified period from the date. Friendly alternative to operator-().
|
![]() ![]() | Subtraction(LocalDate, Period) |
Subtracts the specified period from the date.
|
![]() | ToString()()()() |
Returns a String that represents this instance.
(Overrides ValueType.ToString()()()().) |
![]() | ToString(String, IFormatProvider) |
Formats the value of the current instance using the specified pattern.
|
![]() | WeekOfWeekYear | Gets the week within the WeekYear. See WeekYear for more details. |
![]() | WeekYear |
Gets the "week year" of this local date.
|
![]() | WithCalendar(CalendarSystem) |
Creates a new LocalDate representing the same physical date, but in a different calendar.
The returned LocalDate is likely to have different field values to this one.
For example, January 1st 1970 in the Gregorian calendar was December 19th 1969 in the Julian calendar.
|
![]() | Year | Gets the year of this local date. |
![]() | YearOfCentury | Gets the year of this local date within the century. |
![]() | YearOfEra | Gets the year of this local date within the era. |

Comparisons of dates can be handled in a way which is either calendar-sensitive or calendar-insensitive. Noda Time implements all the operators (and the Equals(LocalDate) method) such that all operators other than Inequality(LocalDate, LocalDate) will return false if asked to compare two values in different calendar systems.
However, the CompareTo(LocalDate) method (implementing IComparable<(Of <(<'T>)>)>) is calendar-insensitive; it compares the two dates historically in terms of when they actually occurred, as if they're both converted to some "neutral" calendar system first.
It's unclear at the time of this writing whether this is the most appropriate approach, and it may change in future versions. In general, it would be a good idea for users to avoid comparing dates in different calendar systems, and indeed most users are unlikely to ever explicitly consider which calendar system they're working in anyway.

Assembly: NodaTime (Module: NodaTime.dll) Version: 1.2.0.0 (1.2.0)