public class Main {
public static void main(String[] argv) throws Exception {
URL u = new URL("http://127.0.0.1/test/test.html");
URLConnection uc = u.openConnection();
SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
uc.setUseCaches(false);
long timestamp = uc.getLastModified();
System.out.println("test.html 文件最后修改时间 :" + ft.format(new Date(timestamp)));
}
}
以上代码运行输出结果为:
你只会cmd命令的五分之一,你学到了啥
使用道具 举报
学会了就对了
使用道具 举报
呵呵
点评
使用道具 举报