<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      計算兩個日期間的 天數

      一、去除周末

      import java.text.ParseException;
      import java.text.SimpleDateFormat;
      import java.util.Date;
      
      public class IntervalDay {
      
          public static void main(String[] args) throws ParseException {
              int dutyDays = getDutyDays("2020-08-20","2020-08-24");
              System.out.println(dutyDays);//3天
          }
      
          @SuppressWarnings("deprecation")
          private static int getDutyDays(String  startDateStr, String endDateStr) throws ParseException {
              int result = 0;
              SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              Date startDate = df.parse(startDateStr);
              Date endDate = df.parse(endDateStr);
      
              while (startDate.compareTo(endDate) <= 0) {
                  if (startDate.getDay() != 6 && startDate.getDay() != 0)
                      result++;
                  startDate.setDate(startDate.getDate() + 1);
              }
              return result;
          }
      }
      

        

       二、去除周末 和法定節假日(包含調休)

      public static int request(String startDateStr, String endDateStr) throws ParseException {
              int result = 0;
              String temp = null;
              Integer type = null;
              SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
              Date startDate = df.parse(startDateStr);
              Date endDate = df.parse(endDateStr);
              while (startDate.compareTo(endDate) <= 0) {
                  BufferedReader reader = null;
                  StringBuffer sbf = new StringBuffer();
                  String httpUrl="http://timor.tech/api/holiday/info/";
                  httpUrl = httpUrl + df.format(startDate);
                  try {
                      URL url = new URL(httpUrl);
                      HttpURLConnection connection = (HttpURLConnection) url
                              .openConnection();
                      connection.setRequestMethod("GET");
                      connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
                      connection.connect();
                      InputStream is = connection.getInputStream();
                      reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
                      String strRead = null;
                      while ((strRead = reader.readLine()) != null) {
                          sbf.append(strRead);
                      }
                      reader.close();
                      JSONParser jsonParser = new JSONParser(sbf.toString());
                       Map<String,Object> map = jsonParser.parseMap();
                       Object obj = map.get("type");
                       LinkedHashMap jsonpObject = (LinkedHashMap) obj;
                       type = Integer.parseInt(jsonpObject.get("type").toString());
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
                  if (type==0 || type ==3){
                      result++;
                  }
                  startDate.setDate(startDate.getDate() + 1);
              }
              return result;
          }
      

        

      posted @ 2020-08-25 10:35  葉不知秋  閱讀(85)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 中文字幕无码av不卡一区| 女人张开腿让男人桶爽| 97人人模人人爽人人少妇| 色悠悠国产精品免费观看| 亚洲男人AV天堂午夜在| 日韩精品中文字幕有码| 精品国产乱一区二区三区| 90后极品粉嫩小泬20p| 亚洲精品国产精品不乱码| 中文字幕成人精品久久不卡| 无码激情亚洲一区| 国产精品永久免费无遮挡| 国产又粗又猛又爽又黄| 国产99久久精品一区二区| 狠狠精品久久久无码中文字幕| 日日碰狠狠添天天爽超碰97| 虎白女粉嫩尤物福利视频| 人人妻人人狠人人爽天天综合网| 日本一区二区三本视频在线观看| 饥渴的熟妇张开腿呻吟视频| 亚洲国产高清第一第二区| 日本高清色WWW在线安全| 国产一区二区三区在线观看免费| 久国产精品韩国三级视频| 亚洲最新无码中文字幕久久| 欧美黑人又粗又大又爽免费| 成人网站网址导航| 国产亚洲国产精品二区| 粉嫩一区二区三区粉嫩视频| 边添小泬边狠狠躁视频| 漂亮的保姆hd完整版免费韩国| 久久精品国产亚洲av麻豆小说| 97av| 国产精品自拍一二三四区| 亚洲人成亚洲人成在线观看| 韩国无码AV片午夜福利| 国产精品久久国产精麻豆99网站| 成人国产一区二区三区精品| 草草浮力影院| 久久自己只精产国品| 无码av最新无码av专区|