Support » Fixing WordPress » Need to change the format of RSS date

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Forum Moderator

    You need to carry this out on the recipient site when you display the feed contents. Feed timestamps are mandated by RFCs.

    My code was generated by Dreamweaver CS4. The recieving page has this code:

    $mm_xsl = new MM_XSLTransform();
    echo $mm_xsl->Transform();

    “blog_feed.xsl” is an XSL include file with the following code:

    <?xml version=”1.0″ encoding=”utf-8″?><!– DWXMLSource=”″ –>
    <!DOCTYPE xsl:stylesheet [
    <!ENTITY nbsp “ ”>
    <!ENTITY copy “©”>
    <!ENTITY reg “®”>
    <!ENTITY trade “™”>
    <!ENTITY mdash “—”>
    <!ENTITY ldquo ““”>
    <!ENTITY rdquo “””>
    <!ENTITY pound “£”>
    <!ENTITY yen “¥”>
    <!ENTITY euro “€”>
    <xsl:stylesheet version=”1.0″ xmlns:xsl=”” xmlns:wfw=”” xmlns:atom=”” xmlns:sy=”” xmlns:slash=”” xmlns:content=”” xmlns:media=”” xmlns:dc=””>
    <xsl:output method=”html” encoding=”utf-8″/>
    <xsl:template match=”/”>
    <xsl:for-each select=”rss/channel/item”>
    <xsl:if test=”position() <= 5″>
    <div class=”feed”>
    <h3><xsl:value-of select=”title”/></h3>
    <xsl:value-of select=”pubDate”/>

    <p><xsl:value-of select=”description” disable-output-escaping=”yes”/></p>

    I don’t know how to change the format of “pubDate”

    I found a partial solution. If anyone else has this problem (formatting the pubDate with XSLT), change this line:

    <xsl:value-of select=”pubDate”/>

    to this:

    <xsl:value-of select=”substring(pubDate,1,16)”/>

    ..and it will get rid of the “14:32:33 +0000” part of the date.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need to change the format of RSS date’ is closed to new replies.