[This is preliminary documentation and is subject to change.]
Returns the period between a start and an end date, using only the given units.

C# | Visual Basic | Visual C++ |
public static Period Between( LocalDate start, LocalDate end, PeriodUnits units )
Public Shared Function Between ( _ start As LocalDate, _ end As LocalDate, _ units As PeriodUnits _ ) As Period
public: static Period^ Between( LocalDate start, LocalDate end, PeriodUnits units )


The period between the given dates, using the given units.

If end is before start, each property in the returned period
will be negative. If the given set of units cannot exactly reach the end point (e.g. finding
the difference between 12th February and 15th March in months) the result will be such that adding it to start
will give a value between start and end. In other words,
any rounding is "towards start"; this is true whether the resulting period is negative or positive.

Exception | Condition |
---|---|
ArgumentException | units contains time units, is empty or contains unknown values. |
ArgumentException | start and end use different calendars. |
Assembly: NodaTime (Module: NodaTime.dll) Version: 1.2.0.0 (1.2.0)