//将GMT格式的时间转换成yyyy-MM-dd HH:mm:ss格式 public String changeGmtTimeToDateTime(String GMTTime) { SimpleDateFormat sf = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z", Locale.ENGLISH); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = null; String dateTime = ""; try { if (!Validator.isEmpty(GMTTime)) { date = sf.parse(GMTTime); dateTime = sdf.format(date); } } catch (ParseException e) { e.printStackTrace(); } return dateTime; }
java中GMT时间格式转换(其中一种方法)
最新推荐文章于 2023-02-17 14:22:16 发布