Search code examples
.nettimefilesystemscreation

Filesysteminfo get the Date of creation


i have some documents that has been copied in a folder.(example with word) when i use filesysteminfo.CreationTime i get the date when i copied it. (right click on the document, (last to select) "eigenschaften")

but when i go into the document and select Datei --> Eigenschaften --> "Date of Creation" i get the "right CreationTime"

greetings, Tyzak


Solution

  • When you copy the file, a new file gets created --> that's why the FileInfo.CreationTime is set to the date/time when you copied the file.

    What you're seeing in the Datei/Eigenschaften is inside Word. That is data that Word keeps track of - it's not a property directly on the file, but a metadata item that Word stores inside the file (in its Word document properties subelements).

    FileInfo has three date/time stamps:

    • CreationTime (when the file was physically created)
    • LastAccessTime (last access to the file in any way)
    • LastWriteTime (last write access to the file)

    Anything more will not be handled by the file system directly.