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.0.8475.0
Syntax public static DateTime OrdinalDate(
OrdinalWeekday occurrence,
DayOfWeek dayOfWeek,
int year,
int month
)
Parameters
- 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.
Return Value
DateTimeA
DateTime structure representing the date
sought.
Remarks
The following table shows the output of the
OrdinalDate method:
Example var thanksgiving = DateTimeExtensions.OrdinalDate(OrdinalWeekday.Fourth, DayOfWeek.Thursday, 2014, 11);
See Also