WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] pubdate formatting... (5 posts)

  1. davve00
    Member
    Posted 6 years ago #

    When I print the pubdate variable using

    echo '<li><a href="'.$item['link'].'">'.$item['title'].'</a> - '.$item['pubdate'].'</li>';

    I get the output

    bla bla bla - Sat, 17 May 2008 14:37:02 +0000

    How can I get the formatting to look like

    bla bla bla - 17 May

    davve

  2. haochi
    Member
    Posted 6 years ago #

    Is that in the feeds? Don't bother to change it because it HAS to be in that format.

  3. davve00
    Member
    Posted 6 years ago #

    yes, the rss, sorry. but is there no way I print only "17 may" and not the whole string???

  4. haochi
    Member
    Posted 6 years ago #

    echo '<li><a href="'.$item['link'].'">'.$item['title'].'</a> - '.date("j M", strtotime($item['pubdate'])).'</li>';

    See: here if the date is not showing and here to find out how to format the dates.

  5. davve00
    Member
    Posted 6 years ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.