Java示例文件修改时间2


Java示例文件修改时间2

import java.net.URL;
import java.net.URLConnection;

public class Main {
   public static void main(String[] argv)throws Exception {
      URL u = new URL(
         "https://www.codingdict.com/cpp_standard_library/cpp_fstream_close.htm");

      URLConnection uc = u.openConnection();
      uc.setUseCaches(false);
      long timestamp = uc.getLastModified();
      System.out.println("The last modification time of file is :"+timestamp);
   }
}