Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6205751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:19:44+00:00 2026-05-24T05:19:44+00:00

This seems like a pretty straightforward question but I haven’t been able to find

  • 0

This seems like a pretty straightforward question but I haven’t been able to find a definitive answer anywhere online. How can I get the date/time a file was created through Java’s file manager? Aside from just the name of a file, what else can I get about the file’s “properties”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:19:45+00:00Added an answer on May 24, 2026 at 5:19 am

    I’m not sure how you’d get it using Java 6 and below. With Java 7’s new file system APIs, it’d look like this:

    Path path = ... // the path to the file
    BasicFileAttributes attributes = 
        Files.readAttributes(path, BasicFileAttributes.class);
    FileTime creationTime = attributes.creationTime();
    

    As CoolBeans said, not all file systems store the creation time. The BasicFileAttributes Javadoc states:

    If the file system implementation does not support a time stamp to indicate the time when the file was created then this method returns an implementation specific default value, typically the last-modified-time or a FileTime representing the epoch (1970-01-01T00:00:00Z).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like a repeated question but i'm not able to get my answer.
This seems like a pretty straightforward thing to do, but I can't find anything
This seems pretty a straight-forward question, but I could not find a specific answer
This seems like the simplest Git question, but I can't find ANYTHING on it.
This one seems like it should be pretty straightforward, but I couldn't quite figure
This seems like it should be pretty straight forward, but I'm apparently confused. I
This feels like it should be pretty simple, but not much seems to be
This seems like such a simple issue but I cannot find an elegant solution.
It's a pretty straightforward question. I'm hoping the answer is both, but I'm worried
This seems like it should be relatively straightforward, I cannot figure out what I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.