我正在通过以下方法阅读 SyndicationFeed。
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential("username", "password");
// Create the reader.
XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = resolver;
XmlReader reader = XmlReader.Create(feedUrl, settings);
SyndicationFeed feed = SyndicationFeed.Load(reader);
但是,从提要中,我需要最后更新时间最多毫秒,但代码只返回到秒部分。
feed.LastUpdatedTime 为 DateTimeOffset,值为 {06/02/2021 00:06:30 +00:00}
// where as this is the data I get back in Postman
<updated>2021-02-06T00:06:30.652Z</updated>
知道如何从原子提要中获取毫秒部分吗?