help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Procedures and functions] Reference for unit 'dateutils' (#rtl)

DecodeDayOfWeekInMonth

Decode a DateTime value in year, month, day of week parts

Declaration

Source position: dateutil.inc line 366

procedure DecodeDayOfWeekInMonth(

  const AValue: TDateTime;

  var AYear: Word;

  var AMonth: Word;

  var ANthDayOfWeek: Word;

  var ADayOfWeek: Word

);

Arguments

AValue

  

DateTime to decode

AYear

  

Returns the year part of AValue.

AMonth

  

Returns the month part of AValue.

ANthDayOfWeek

  

Returns which ADayofWeek of AValue.

ADayOfWeek

  

Returns the day of week part of AValue.

Description

DecodeDayOfWeekInMonth decodes the date AValue in a AYear, AMonth, ADayOfweek and ANthDayOfweek. (This is the N-th time that this weekday occurs in the month, e.g. the third saturday of the month.)

See also

NthDayOfWeek

  

Calculate which occurrence of weekday in the month a given day represents

EncodeDateMonthWeek

  

Encodes a year, month, week of month and day of week to a DateTime value

#rtl.sysutils.DayOfWeek

  

Returns the day of the week.

EncodeDayOfWeekInMonth

  

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

TryEncodeDayOfWeekInMonth

  

Encode a year, month, week, day of week triplet to a TDateTime value

Example

Program Example105;

{ This program demonstrates the DecodeDayOfWeekInMonth function }

Uses SysUtils,DateUtils;

Var
  Y,M,NDoW,DoW : Word;
  D : TDateTime;
Begin
  DecodeDayOfWeekInMonth(Date,Y,M,NDoW,DoW);
  D:=EncodeDayOfWeekInMonth(Y,M,NDoW,DoW);
  Write(DateToStr(D),' is the ',NDow,'-th ');
  Writeln(formatdateTime('dddd',D),' of the month.');
End.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505