我使用 Web 界面将文件上传到用户的 OneDrive,然后使用两个 API 获取文件信息:MS Graph API 和 SharePoint REST API。
对于MS Graph API,我使用了以下端点:
https://graph.microsoft.com/v1.0/drives/b{drive-id}/items/{item-id}
我得到的回应:
{
***
"createdDateTime": "2019-12-09T15:03:52Z",
"eTag": "\"{9E8670D4-185F-4E8D-B2E5-61819E769BC3},2\"",
"lastModifiedDateTime": "2019-12-09T15:04:12Z",
"name": "test.psd",
"cTag": "\"c:{9E8670D4-185F-4E8D-B2E5-61819E769BC3},2\"",
"size": 56783858,
"lastModifiedBy": {
"user": {
"email": "batman@keepitdev02.onmicrosoft.com",
"id": "6e14d588-63db-46e4-b70d-0f00050dafa4",
"displayName": "Batman"
}
},
"fileSystemInfo": {
"createdDateTime": "2019-12-09T15:03:52Z",
"lastModifiedDateTime": "2019-12-09T15:04:12Z"
},
***
}
对于SharePoint REST API,我使用了端点:
https://*my.sharepoint.com/personal/*/_api/Web/GetFileByServerRelativePath(decodedurl='*/test.psd')
我得到的回应:
"LinkingUrl": "",
"MajorVersion": 1,
"MinorVersion": 0,
"Name": "test.psd",
"ServerRelativeUrl": "/*/test.psd",
"TimeCreated": "2019-12-09T15:03:52Z",
"TimeLastModified": "2019-12-09T15:04:11Z",
"Title": null,
"UIVersion": 512,
"UIVersionLabel": "1.0",
"UniqueId": *
}
API返回的修改时间为:
质谱图:2019-12-09T15:04: 12Z
SharePoint REST API:2019-12-09T15:04: 11Z
如您所见,它们相差 1 秒。有人可以解释为什么我会看到这样的差异吗?