none
Sharepoint Online list item last changed datetime when using explorer view

    Question

  • Dear experts,

    I'm using CSOM to upload files to Sharepoint Online. When I do so, I can set the Created and Modified datetimes to anything I like.

    When using the web-based view in Sharepoint Online, the Created and Modified datetime I set, displays as expected.

    However, when using the 'Explorer View' or mapping through WebDav, the Modifieddate of the file equals the upload date+time in Sharepoint Online, but the Created date does respect the datetime I set.

    Which property of my list item is the Modified time that displays through WebDav, and how do I modify it using CSOM so my WebDav client also sees the customized Modified Date?

    Wednesday, January 4, 2017 1:24 PM

Answers

  • Hi Jos,

    Per my test, the Date modified showed in explorer view is from different field in SQL table from the field for Modified column in browser view.

    Date modified in explorer view is from TimeLastModified in AllDocs table and Modified in browser view is from  tp_Modified in AllUserData table. And the two fields will show different values if we include checkout and checkin action in the code.

    You can test again without checkout and checkin to see what happens. Before that, you need to disable Require check out in library setting.

    Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Jos Lieben Friday, January 13, 2017 1:50 PM
    Friday, January 13, 2017 2:05 AM
    Moderator

All replies

  • Hi Jos,

    Could you please help verify the time zone set in your SharePoint site and your local PC and let us know the Date Time value you set for test?

    I tested the same scenario per your post in my environment, however the Created and Modified were displayed correctly in explorer view.

    Does this issue occur for all the files?

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, January 6, 2017 8:42 AM
    Moderator
  • Hi Victoria,

    I've just set the timezone from -8 to +1 in Onedrive for Business, that was indeed not matching my local timezone. However, no change.

    I'm setting the date/time on a file like this:

            [Microsoft.SharePoint.Client.File] $existingFile2 = $Web.GetFileByServerRelativeUrl($fileUrl)
            $Context.Load($existingFile2)
            $Context.ExecuteQuery()
            $existingFile2.Checkout()
                $Context.ExecuteQuery()
                $item2 = $existingFile2.ListItemAllFields
                $item2["Created"] = $LocalFile.CreationTimeUtc
                $item2["Author"] = $user
                $item2["Modified"] = $LocalFile.LastWriteTimeUtc
                $item2["Editor"] = $user
                $item2.Update()
                $existingFile2.CheckIn("", [Microsoft.SharePoint.Client.CheckinType]::OverwriteCheckin)
                $Context.ExecuteQuery()

    I've tried this with versioning enabled and versioning disabled (on the library).

    Both the CreationTimeUtc and LastWriteTimeUtc values of the local file are:
    Wednesday, January 4, 2017 9:12:10 AM (.NET datetime object), but as the screenshot through explorer view shows, only the created date gets set to the desired and correct value:

    In the Sharepoint Online web view it looks correct, and this occurs for all files.

    Friday, January 6, 2017 12:17 PM
  • Hi Jos,

    Per my test, the Date modified showed in explorer view is from different field in SQL table from the field for Modified column in browser view.

    Date modified in explorer view is from TimeLastModified in AllDocs table and Modified in browser view is from  tp_Modified in AllUserData table. And the two fields will show different values if we include checkout and checkin action in the code.

    You can test again without checkout and checkin to see what happens. Before that, you need to disable Require check out in library setting.

    Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Jos Lieben Friday, January 13, 2017 1:50 PM
    Friday, January 13, 2017 2:05 AM
    Moderator
  • Thanks Victoria, that did the trick, not checking it out before modification maintains the proper change date / time.
    Friday, January 13, 2017 1:51 PM