delphi 判断给定日期的天数,给定日期距离月初的天数,给定日期距离月末的天数

Posted 那里的天空

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了delphi 判断给定日期的天数,给定日期距离月初的天数,给定日期距离月末的天数相关的知识,希望对你有一定的参考价值。

uses

dateutils;

//判断给定日期的天数

label1.caption := inttostr(DaysInAMonth(yearof(StrToDate(Trim(Edit_riqi.Text))),monthof(StrToDate(Trim(Edit_riqi.Text))) ));

//给定日期距离月初的天数

label2.caption := inttostr(dayof(StrToDate(Trim(Edit_riqi.Text)) )-1);

//给定日期距离月末的天数

label3.caption := IntToStr(StrToInt(label1.caption)-StrToInt(label2.caption));

 

    

 

以上是关于delphi 判断给定日期的天数,给定日期距离月初的天数,给定日期距离月末的天数的主要内容,如果未能解决你的问题,请参考以下文章