Recurrence.CreateDateTimeIndex Method

Definition

Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

CreateDateTimeIndex(DateTime, Int32, SortOrder) Creates an index of DateTime keys of the specified length using the specified start date.
CreateDateTimeIndex(DateTime, DateTime, Boolean, Boolean) Creates an index of DateTime keys between the specified dates.
CreateDateTimeIndex(DateTime, TimeSpan, Boolean, Boolean) Creates an index of DateTime keys from the specified start date over the specified time span.

CreateDateTimeIndex(DateTime, Int32, SortOrder)

Creates an index of DateTime keys of the specified length using the specified start date.
C#
public Index<DateTime> CreateDateTimeIndex(
	DateTime startDate,
	int length,
	SortOrder sortOrder = SortOrder.Ascending
)

Parameters

startDate  DateTime
The first date in the index.
length  Int32
The length of the index.
sortOrder  SortOrder  (Optional)
Indicates whether the index should be sorted in ascending or descending order.

Return Value

Index<DateTime>
An index containing length dates following the recurrence pattern starting at startDate.

CreateDateTimeIndex(DateTime, DateTime, Boolean, Boolean)

Creates an index of DateTime keys between the specified dates.
C#
public Index<DateTime> CreateDateTimeIndex(
	DateTime startDate,
	DateTime endDate,
	bool startInclusive = false,
	bool endInclusive = false
)

Parameters

startDate  DateTime
The first date in the index.
endDate  DateTime
The last date in the index.
startInclusive  Boolean  (Optional)
Indicates whether the entire range should be included, even if the first date extends past startDate.
endInclusive  Boolean  (Optional)
Indicates whether the entire range should be included, even if the last date extends past endDate.

Return Value

Index<DateTime>
An index containing dates following the recurrence pattern between startDate and endDate, inclusive.

Remarks

If startDate is larger than endDate, the dates in the index are in descending order, most recent date first.

CreateDateTimeIndex(DateTime, TimeSpan, Boolean, Boolean)

Creates an index of DateTime keys from the specified start date over the specified time span.
C#
public Index<DateTime> CreateDateTimeIndex(
	DateTime startDate,
	TimeSpan timeSpan,
	bool startInclusive,
	bool endInclusive
)

Parameters

startDate  DateTime
The first date in the index.
timeSpan  TimeSpan
The total time span of dates in the index.
startInclusive  Boolean
Indicates if the first entry in the index should be adjusted so the index contains the entire range even if that makes it longer than timeSpan.
endInclusive  Boolean
Indicates if the last entry in the index should be adjusted so the index contains the entire range even if that makes it longer than timeSpan.

Return Value

Index<DateTime>
An index of dates following the recurrence pattern starting with startDate and up to timeSpan away from startDate.

Remarks

The timeSpan is relative to startDate, not to the actual first date in the index. If timeSpan is negative, the dates in the index are in descending order.

See Also