C C++日期格式转Java

  public static String formatTime(String t) {
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd yyyyHH:mm:ss", Locale.US);
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMddHHmmss");
        try {
            return sdf2.format(sdf.parse(t));
        } catch (ParseException ex) {
            Logger.getLogger(TL.class.getName()).log(Level.SEVERE, null, ex);
        }
        return "";
    } 

  //            "SOFTVER":"Feb 10 201520:05:34",

            String HVER = (String) job.get("SOFTVER"); 

你可能感兴趣的:(java)