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));

 

    

 

posted on 2017-04-15 18:28  那里的天空  阅读(1049)  评论(0编辑  收藏  举报

导航