DateTimeExtensionsOrdinalDate(OrdinalWeekday, DayOfWeek, Int32, Int32) Method
Returns the date of the nth occurrence of a particular
weekday in a given month.
Namespace: InnerDrive.CoreAssembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.2.9017.0
public static DateTime OrdinalDate(
OrdinalWeekday occurrence,
DayOfWeek dayOfWeek,
int year,
int month
)
- occurrence OrdinalWeekday
- The number of the occurrence.
- dayOfWeek DayOfWeek
- The day of week to use.
- year Int32
- The calendar year to use.
- month Int32
- The month to use, where 1 = January and 12 = December.
DateTimeA
DateTime structure representing the date
sought.
The following table shows the output of the
OrdinalDate method:
var thanksgiving = DateTimeExtensions.OrdinalDate(OrdinalWeekday.Fourth, DayOfWeek.Thursday, 2014, 11);
// Result: 2014-11-27