Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

File Modification time..  RSS feed

akhter wahab
Ranch Hand
Posts: 151
Java MyEclipse IDE Python
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have text file that i m modifying after an interval but i m getting the same time after modification too here is the code

import java.sql.Time;
import java.util.Date;

public class Execute {
//private LoadLinkifyIndeedTerm myThread;

public static void main(String[] args) {
// Create an instance of file object.
File file = new File("test.txt");
// Get the last modification information.
Long lastModified = file.lastModified();

// Create a new date object and pass last modified information
// to the date object.
Date date = new Date(lastModified);
Time time= new Time(lastModified);

// We know when the last time the file was modified.

i want to kknow the last modification time of the file
thanks in advance
Christophe Verré
Posts: 14691
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Do not duplicate threads. Continue there.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!