• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get file created date in Java?

 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one?
 
John McAlroy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Date d = new Date(new File("filename.txt").lastModified());
Creation date is forgotten after the file is modified so lastModified() is all you can get.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic