• 把格式日期转换成毫秒


      /**
         *  把"yyyy-MM-dd HH:mm:ss"格式日期转换成毫秒
         *@param strDate
         *@return 转换后毫秒的值
         *@author hongj
         */
        public long paseDateTomillise(String strDate){
            String year = null;
            String month = null;
            String day = "";
            String hms = "";
            if(strDate.contains(" ") && !strDate.endsWith(" ")){
                String[] s = strDate.split(" ");
                hms = s[1];
            }
            String[] getYear = strDate.split("-");
            year = getYear[0].substring(2, 4);
            month = getYear[1];
            if("1".equalsIgnoreCase(month) || "01".equalsIgnoreCase(month)){
                month = "JAN";
            }else if("2".equalsIgnoreCase(month) || "02".equalsIgnoreCase(month)){
                month = "FEB";
            }else if("3".equalsIgnoreCase(month) || "03".equalsIgnoreCase(month)){
                month = "MAR";
            }else if("4".equalsIgnoreCase(month) || "04".equalsIgnoreCase(month)){
                month = "APR";
            }else if("5".equalsIgnoreCase(month) || "05".equalsIgnoreCase(month)){
                month = "MAY";
            }else if("6".equalsIgnoreCase(month) || "06".equalsIgnoreCase(month)){
                month = "JUN";
            }else if("7".equalsIgnoreCase(month) || "07".equalsIgnoreCase(month)){
                month = "JUL";
            }else if("8".equalsIgnoreCase(month) || "08".equalsIgnoreCase(month)){
                month = "AUG";
            }else if("9".equalsIgnoreCase(month) || "09".equalsIgnoreCase(month)){
                month = "SEPT";
            }else if("10".equalsIgnoreCase(month)){
                month = "OCT";
            }else if("11".equalsIgnoreCase(month)){
                month = "NOV";
            }else if("12".equalsIgnoreCase(month)){
                month = "DEC";
            }
            if(getYear[2].contains(" ")){
                day = getYear[2].split(" ")[0];
            }else{
                day = getYear[2];
            }
            String datees = day+"-"+month+"-"+year+" "+hms;
            Date datee = new Date(datees);
            return datee.getTime();
        }
  • 相关阅读:
    up6-chrome 45+安装教程
    HttpUploader7-授权码配置
    jsp-MySQL连接池
    WordPaster2-正式包布署说明
    HTTP文件上传插件开发文档-ASP
    HTTP文件上传插件开发文档-JSP
    eWebEditor9.x整合教程-Xproer.WordPaster
    42. Trapping Rain Water
    41. First Missing Positive
    40. Combination Sum II
  • 原文地址:https://www.cnblogs.com/jh5240/p/2676888.html
Copyright © 2020-2023  润新知