Noda Time
CreateComparer Method (baseDateTime)
NamespacesNodaTimePeriodCreateComparer(LocalDateTime)

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

Creates an IComparer<(Of <(<'T>)>)> for periods, using the given "base" local date/time.
Declaration Syntax
C#Visual BasicVisual C++
public static IComparer<Period> CreateComparer(
	LocalDateTime baseDateTime
)
Public Shared Function CreateComparer ( _
	baseDateTime As LocalDateTime _
) As IComparer(Of Period)
public:
static IComparer<Period^>^ CreateComparer(
	LocalDateTime baseDateTime
)
Parameters
baseDateTime (LocalDateTime)
The base local date/time to use for comparisons.
Return Value
The new comparer.
Remarks
Certain periods can't naturally be compared without more context - how "one month" compares to "30 days" depends on where you start. In order to compare two periods, the returned comparer effectively adds both periods to the "base" specified by baseDateTime and compares the results. In some cases this arithmetic isn't actually required - when two periods can be converted to durations, the comparer uses that conversion for efficiency.

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