I need to read the contents of a SharePoint library and get the metadata of the files.

Every item in a SharePoint library has a created time and a modified time.

Is is possible to get the actual time a document was modified before it was uploaded to a library? Or can I get only the modified time of the library item?

p.s. I am using a SPO site in a tenant; I am only a site admin

2 Answers 2


The time shown by the modified field, is the actual time the file that is stored in SharePoint was modified. As for the time the file was modified on the a user's machine, you'll most likely need to check a local copy of the file/have access to their machine.

Most users open the file from SharePoint and their changes are synchronised with SharePoint, so the modified time is accurate (in terms of when the desktop application saved the file and synchronised those changes with SharePoint).

  • My requirement is to automatically re-upload files in the library, if the source files were modified after being uploaded here.
    – entryton
    May 20, 2022 at 18:41
  • Have you considered just using the sync functionality? May 20, 2022 at 22:36
  • I need to get the files from a webservice
    – entryton
    May 23, 2022 at 12:45
  • I'm not sure what you mean. Aren't the source files on a user's machine? or are they being modified elsewhere? If they're on a Windows machine then the source files can be kept in sync using the OneDrive app (SharePoint library sync). May 23, 2022 at 13:16
  • I need to get the files from a webservice, and if they are newer than the files in the library, then upload them
    – entryton
    May 23, 2022 at 13:45

"Is is possible to get the actual time a document was modified before it was uploaded to a library" Yes and no.

In many cases there will be a difference between the actual time the file was modified and when it was uploaded to SharePoint.

Quite a few file formats contain the creation and modified date in the file itself. For example, in Word click "File" | "Info" to see the actual date the Word file was created and last modified. Which file formats use this mechanism? docx, xlsx, pptx, vsdx, pdf, jpg, dwg, audio and video files. For msg and eml you may want to use the sent date as the modified date.

File formats without dates are txt, zip, gif, ...

Basically, if the modified dates from SharePoint are good enough use them. If not, you will need to look for 3rd party tools that offer this capability.

Paul | SLIM Applications

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.