zoukankan      html  css  js  c++  java
  • 判断闰年、平年,28天,29天的计算方法,给出起年起月,止年止月,判断某一年的2月份的天数,并自动计算

                  

    {
    起月起日查询} if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))=2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))=29) then begin if DaysInAMonth(strtoint(Trim(Edit_niandu.Text)), 2)=28 then begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+'28' end else begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['qiri']); end; end; if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))<>2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))<>29) then begin kaishiriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+Trim(ADOQuery_temp.FieldValues['qiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['qiri']); end; {止月止日查询} if (StrToInt(Trim(ADOQuery_temp.FieldValues['zhiyue']))=2) and (StrToInt(Trim(ADOQuery_temp.FieldValues['zhiri']))=29) then begin //查询当月的月份天数 //瑞年 if DaysInAMonth(strtoint(Trim(Edit_niandu.Text)), 2)=28 then begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+'28'; end //平年 else begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['zhiri']); end; end else begin if (StrToInt(Trim(ADOQuery_temp.FieldValues['qiyue']))=1) and (StrToInt(Trim(ADOQuery_temp.FieldValues['qiri']))=1) then begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text)))+'-'+'12'+'-'+'31'; end else begin jieshuriqi:=IntToStr(StrToInt(Trim(Edit_niandu.Text))+1)+'-'+Trim(ADOQuery_temp.FieldValues['zhiyue'])+'-'+Trim(ADOQuery_temp.FieldValues['zhiri']); end; end;











  • 相关阅读:
    Django多表操作
    Django单表操作
    Django模板语言的复用
    DTL
    Django视图层、虚拟环境
    Django路由详解
    初识Django
    web框架
    JQ初级
    linux的基础配置命令
  • 原文地址:https://www.cnblogs.com/lantianhf/p/6127655.html
Copyright © 2011-2022 走看看