Prabhu Murthi
Prabhu Murthi

Reputation: 2876

what is the difference between <pubDate> and <dc:date> in feed's structure

can any one please let me know the main difference between <pubDate> and <dc:date> in feed's structure. also please explain

<dc:date>
<dc:creator>
<dc:....>
<dc:....>

will those be required for building feeds?

Upvotes: 3

Views: 7246

Answers (2)

ChrisF
ChrisF

Reputation: 137178

According to this page (from the internet archive):

So, let me get this straight. RFC2822 is the format used by the pubDate element in RSS 2.0, and looks like this: Fri, 21 Nov 1997 09:55:06 -0600

ISO8601 is used in the dc:date element in RSS 1.0 (and sometimes RSS 2.0) and looks like this: 1998-05-12T14:15:00

The difference is in the format. Both define the same thing.

This post (from the internet archive) has an explanation of the <dc:creator> tag and how it differs from the <author> tag:

Therefore, if you are only using the name of the author in an RSS item make sure to use the <dc:creator> tag and not the <author> tag

The RSS standard is flexible enough for you to miss out some information, but some readers might object if there is, say, a date missing which is useful for ordering the items. Personally, I'd include the date and author and be consistent about which form I used.

Upvotes: 4

Dan
Dan

Reputation: 580

The accepted answer is not correct - they may not represent the exact same date because the fields are defined by two different entities and have two different definitions. The DC:* elements represent Dublin Core metadata, and they have their own definition as to what the date represents. Additionally, the DC date may be very imprecise and only specify, for example, the year. Thus the format of the DC Date value can vary tremendously (and yet may also have the exact same format as the pubDate for many feeds). You should not use the DC:Date value just because it is in a format you prefer for one specific feed, as other feeds may use a different or less precise DC:Date format.

The definition of DC:Date:

Used without a subelement designation (i.e., unqualified), a DC.Date element contains a date associated with the creation or availability of the resource.

The definition of pubDate:

Its value is a date, indicating when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date.

For one major news source I am consuming RSS from, for some items they have totally different values for DC:Date and pubDate, even though they are both in the exact same format. In their case the DC:Date appears to indicate the last time the item was updated (which does not appear to be standard from any RSS or DC definitions I've found).

Upvotes: 3

Related Questions