⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tdcomp.java

📁 这个是我们做土地局的一个项目。感觉不错。欢迎下载
💻 JAVA
字号:
package huayi.nb.tdComp;
import java.io.*;
import java.util.*;

public class tdComp{
   public String td;
//1代表输入,2代表已存在即1是否在2之内
 public boolean comparetime(String kss1,String ksf1,String jss1,String jsf1,String kss2,String ksf2,String jss2,String jsf2){
         int kaishishi1=Integer.parseInt(kss1);
         int jieshushi1=Integer.parseInt(jss1);
         int kaishifen1=Integer.parseInt(ksf1);
         int jieshufen1=Integer.parseInt(jsf1);
         int kaishishi2=Integer.parseInt(kss2);
         int jieshushi2=Integer.parseInt(jss2);
         int kaishifen2=Integer.parseInt(ksf2);
         int jieshufen2=Integer.parseInt(jsf2);
         
         int kaishitime1=kaishishi1*60+kaishifen1;
         int jieshutime1=jieshushi1*60+jieshufen1;
         int kaishitime2=kaishishi2*60+kaishifen2;
         int jieshutime2=jieshushi2*60+jieshufen2;
  
         if((kaishitime1>=kaishitime2)&&(kaishitime1<jieshutime2)){
             return true;//在范围之内
             }else{
               if (kaishitime1<kaishitime2){
                   if (jieshutime1>kaishitime2){
                        return true;//在范围之内
                      }else{
                        return false;    //不在范围之内
                       }
                 }else{
                   return false; //不在范围之内
                  }
             }
}             

 public boolean comparedate(String riqi1,String riqi2){         
     if (riqi1.compareTo(riqi2.trim())==0){
     	return true;//日期相同
          }else{
          return false;//日期不同
           } 	
 	
  }
public String  returntd(){
  GregorianCalendar gcalendar=new GregorianCalendar();
 String Date1;
   if ((gcalendar.get(gcalendar.MONTH)>=0)&&(gcalendar.get(gcalendar.MONTH))<9){
      Date1=gcalendar.get(gcalendar.YEAR)+"-0"+(gcalendar.get(gcalendar.MONTH)+1);
     }else{
      Date1=gcalendar.get(gcalendar.YEAR)+"-"+(gcalendar.get(gcalendar.MONTH)+1);
       }
   if ((gcalendar.get(gcalendar.DATE)>0)&&(gcalendar.get(gcalendar.DATE)<10)){
     Date1=Date1+"-0"+gcalendar.get(gcalendar.DATE);
     }else{
     Date1=Date1+"-"+gcalendar.get(gcalendar.DATE);
     }
   String Time1;
   if (gcalendar.get(gcalendar.AM_PM)==1) {
      Time1=""+(gcalendar.get(gcalendar.HOUR)+12);
     }else{
       if (gcalendar.get(gcalendar.HOUR)>9){
          Time1=""+gcalendar.get(gcalendar.HOUR);
        }else{
          Time1="0"+gcalendar.get(gcalendar.HOUR);
         }
       }
    if ((gcalendar.get(gcalendar.MINUTE)>=0)&&(gcalendar.get(gcalendar.MINUTE)<10)){
        Time1=Time1+":0"+gcalendar.get(gcalendar.MINUTE);
     }else{
        Time1=Time1+":"+gcalendar.get(gcalendar.MINUTE);
      }
      td=Date1+" "+Time1;
return td;
}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -