delphi MonthDays:给出一个月的天数  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi MonthDays:给出一个月的天数


声明:const MonthDays : array [Boolean] of TDayTable =
((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));

描述:MonthDays常量是SysUtils单元中比较有用的部分,它给出了一个月有多少天。如果一个闰年(第一个数组参数Boolean为True)的2月分,它返回29。

begin
// 2000年2月份有多少天?
ShowMessage('Days in February 2000 = '+
IntToStr(MonthDays[IsLeapYear(2000)][2]));
end;

程序运行结果: Days in February 2000 = 29

推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.16493201255798 seconds