Skip to content

EncodeDayOfWeekInMonth

Encodes a year, month, week, day of week specification to a TDateTime value

Declaration

Source position: dateutil.inc line 382

  function EncodeDayOfWeekInMonth(const AYear: Word; const AMonth: Word; 
                                 const ANthDayOfWeek: Word; 
                                 const ADayOfWeek: Word) : TDateTime;

Description

EncodeDayOfWeekInMonth encodes AYear, AMonth, ADayOfweek and ANthDayOfweek to a valid date stamp and returns the result.

ANthDayOfweekis the N-th time that this weekday occurs in the month, e.g. the third Saturday of the month.

For an example, see DecodeDayOfWeekInMonth .

Errors

If any of the values is not in range, then an EConvertError exception will be raised.

See also

Name Description
DecodeDayOfWeekInMonth Decode a TDateTime value in year, month, day of week parts
EncodeDateMonthWeek Encodes a year, month, week of month and day of week to a TDateTime value
NthDayOfWeek Calculate which occurrence of weekday in the month a given day represents
#rtl.sysutils.DayOfWeek Returns the day of the week.
TryEncodeDayOfWeekInMonth Encode a year, month, week, day of week triplet to a TDateTime value