delphi中计算指定日期是该月第几周的函数

时间:2023-12-23 08:29:08

NthDayOfWeek 
计算并返回指定日期是该月第几周


Unit:
DateUtils

function NthDayOfWeek(const AValue: TDateTime): Word;

Example:

Uses SysUtils,DateUtils;

Begin
  Write('Today is the ',NthDayOfWeek(Today),'-th ');
  Writeln(formatdateTime('dddd',Today),' of the month.');
End.