• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File attributes

 
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is it possible to get the created on date/time using Java. In File class we have an API lastModified() but how to get createdon date/time.
Regards,
shankar.
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know of any OS file systems that keep the last modified and creation timestamps separately. You only see the last modified timestamp which is why the API only has lastModified(). If the file happens to be a new one, the last modified timestamp would be the creation timestamp as well.
To preserve the creation timestamp, that information would have to be embedded into the document itself, similar to what MS Word does with its .doc files. But that is application specific behavior and I don't think that's something that you'll find being supported in the standard Java API anytime soon, if ever.
Junilu
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In windows, we can see the created,modified,accessed timestamps of any file by viewing its properties. I was mentioning that... Is it possible to get these timestamps ??
shankar.
 
reply
    Bookmark Topic Watch Topic
  • New Topic