Getting Last Modified Date from a file name

Posted on 2004-11-22
Last Modified: 2010-03-31
I know how to set a "lastModifiedDate" but not how to get it from a file. I read somewhere that the timestamps are stored in a Directory Record. Any way the questions is,
I need a method which will return the date and time of when the file was last modified.
Question by:rebornassassin
    LVL 33

    Accepted Solution


    Author Comment

    i need the time as well
    this solves half the problem

    Author Comment

    ok got it
    LVL 2

    Expert Comment


    What if I needed to find out the last modified date & time of a file that was not created by a JAVA program.

    Say I created a file named abc.doc in Microsoft Word on 11th November of 2004 and wrote something in it. Now,  on the 22nd of November, I want to find out the last modified date & time of the file abc.doc from a JAVA program. What method should I use....Or the comment posted by SAJUKS will work..
    LVL 33

    Expert Comment

    The question was answered correctly be me as indicated  by the askers last commen(rebornassasin).The final post is by some other person and not the original asker. So i do deserve the points :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now