Export (0) Print
Expand All

SyndicationFeed.LastUpdatedTime Property

Gets and sets the time the feed was last updated.

Namespace:  System.ServiceModel.Syndication
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)

public DateTimeOffset LastUpdatedTime { get; set; }

Property Value

Type: System.DateTimeOffset
A DateTimeOffset instance set to the time the feed was last updated.

When serialized to Atom 1.0, the LastUpdatedTime property is written to an <updated>element.

When serialized to RSS 2.0, the LastUpdatedTime property is written to a <lastBuildDate> element.

The following code shows how to se the LastUpdatedTime property on a SyndicationFeed instance.

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.LastUpdatedTime = DateTimeOffset.Now;

The following XML shows how the LastUpdatedTime property is serialized to Atom 1.0.

<updated>2007-04-13T17:29:38Z</updated>

The following XML shows how the LastUpdatedTime property is serialized to RSS 2.0.

<lastBuildDate>Fri, 13 Apr 2007 17:29:38 Z</lastBuildDate>
<category domain="CategoryScheme">FeedCategory</category>
<a10:link rel="alternate" type="text/html" title="Link Title" length="1000" href="http://contoso/link" />
<generator>Sample Code</generator>

<a10:contributor>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://contoso/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:contributor>

<a10:author>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://contoso/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:author>
<image>
  <url>http://contoso/image.jpg</url>
  <title>Feed Title</title>
  <link>http://feed/Alternate/Link</link>
</image>
<a10:id>FeedID</a10:id>
<a10:link customAttribute="value" rel="alternate" type="text/html" title="Link Title" length="1000" href="http://contoso/link" />

<CustomElement>Some text</CustomElement>
<item>
  <guid isPermaLink="false">ItemID</guid>
  <link>http://contoso/items</link>
  <title>Item Title</title>
  <description>Some text content</description>
  <a10:updated>2007-04-13T17:29:38Z</a10:updated>
</item>

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2015 Microsoft