张志峰的博客

水滴石川,积少成多。

导航

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

Posted on 2015-05-26 18:09  ╰★张志峰★╮  阅读(1628)  评论(0编辑  收藏  举报

 

 

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.