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

相关阅读 >>

Delphi中time消息的使用方法

Delphi中使用 twebbrowser 编辑网页

Delphi webbrowser 释放注意事项

Delphi blockread和blockwrite读写文件

tstrings 的用法

Delphi版的创建高权限进程

Delphi 10 seattle中的画布上绘制字符

Delphi中调用api函数exitwindowsex可以实现系统的关机,注销,和重启

Delphi 按f11程序全屏

Delphi 解决idtcpclient和idtcpserver通信中文乱码问题

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...