- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi MonthOfTheYear:取得一个TDateTime变量的月份在年度中的索引
声明:function MonthOfTheYear ( const Date : TDateTime ) : Word;
描述:MonthOfTheYear函数返回月份在年中的索引值。
这个值的范围在1到12(一月到12月)之间。
var
myDate : TDateTime;
begin
myDate := EncodeDate(2002, 10, 29);
ShowMessage('The month of the year = '+
IntToStr(MonthOfTheYear(myDate)));
end;
程序运行结果:
The month of the year = 10