URL urlA = new URL(url);
HttpURLConnection urlcon = (HttpURLConnection) urlA.openConnection();
String lastModified = urlcon.getHeaderField("Last-Modified");
if(StringUtils.isNotBlank(lastModified)){
String format = "EEE, dd MMM yyyy HH:mm:ss zzz";
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
Date d = sdf.parse(lastModified);
}
远程服务器上文件的Last-Modified 格式化
最新推荐文章于 2021-02-25 08:14:41 发布