Forums

[resolved] Still the date format thing... (4 posts)

  1. Todaro
    Member
    Posted 5 years ago #

    Dear experts,

    First, I'm a newbie. Please have it in mind if you feel like willing to help me. Thanks.

    As a newbie I'm having a really hard time trying to figure out how to change date formats.

    I'm not an English native speaker and, thus, my blog is written in my mother language, Brazilian Portuguese. That's why I need to move date formats from the default English notation (e.g. "February 7th, 2007") to Portuguese ("7 de fevereiro de 2007").

    I've been able to translate days and months into Portuguese by editing the proper php file but now dates are being shown as "7th Fevereiro 2007".

    Now, the question: how can I get rid of that "th" and fill in the blanks with the preposition "de"?

    Thanks in advance.

  2. moshu
    Member
    Posted 5 years ago #

    Due to the bad habits of certain theme designers the date format is hard coded in the template file, like this (in index)
    <?php the_time('F jS, Y') ?>

    Go to this site to learn about those letters (S)
    http://php.net/date

    You'll need something like:
    `<?php the_time('j \\d\e F \\d\e Y') ?>

  3. moshu
    Member
    Posted 5 years ago #

    And here is another solution by another WP user:
    http://wordpress.org/support/topic/104253?replies=3#post-513646

  4. Todaro
    Member
    Posted 5 years ago #

    The "'j \\d\e F \\d\e Y'" tip was right what I needed.

    Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic