SharePoint WCF-Services JSON DateTime格式在C#中解析
我正在尝试通过较旧的_vti_bin/client.svc端点从SharePoint API读取一些数据,
我似乎找不到这是什么类型的日期格式,以及如何通过C#解析它。
返回的时间戳是:
"LastContentModifiedDate": "/Date(2022,3,18,13,12,28,990)/"
年度和月很明显,因此,如果我知道所有的价值观,我可以自己解析。是否有正式的定义或一种可靠地解析此方法的方法?这是DateTime或DateTimeOffset还是其他?
试图在DateTime或DateTimeOffset中脱口而出时,我只是得到了例外。
I am trying to read some data from the SharePoint API via the older _vti_bin/client.svc endpoint
I can't seem to find what type of date format this is and how I can parse it via C#.
The timestamp being returned is:
"LastContentModifiedDate": "/Date(2022,3,18,13,12,28,990)/"
The year and month are obvious so I could parse it myself if I knew what all the values are. Is there a formal definition for this or a way to parse this reliably? Is this a DateTime or DateTimeOffset or something else?
I just get an exception when trying to deserialize to a DateTime or DateTimeOffset.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
/ date(...)/格式是Microsoft的内置JSON日期格式。
您可以尝试使用下面的代码对其进行解析。
您也可以查看这篇文章,提供了许多方法。
The /Date(...)/ format is Microsoft's built-in JSON date format.
You can try to parse it using the code below.
You can also check out this post, which provides a lot of methods.