Forums

[resolved] How to custom format $post_date (3 posts)

  1. ricardonunez
    Member
    Posted 2 months ago #

    Hi there,

    I am trying to do exactly the same thing but it does not seem to work.

    My code:

    echo "

  2. $post_title - $post->post_date; ?>
  3. ";

    What I get:

    “The title” - 2008-10-24 10:22:18

    What I want:

    “The title” - October 24, 2008

    If I change the code to:

    echo "

  4. $post_title - mysql2date('j M Y', $post->post_date);
  5. ";

    I get:

    “The title” - mysql2date('j M Y', 2008-10-24 10:22:18);

    Thanks in advance for the help

  • MichaelH
    moderator
    Posted 2 months ago #

    Wouldn't it be something like this?

    echo $post_title . mysql2date('j M Y', $post->post_date);
  • ricardonunez
    Member
    Posted 2 months ago #

    Thanks Michael, it works just fine!!

  • Reply

    You must log in to post.

    About this Topic

    Tags