Forums

[resolved] Need to make "get date" work in Spanish (3 posts)

  1. ortegara
    Member
    Posted 5 years ago #

    Hello,

    I have my WordPress translated to Spanish (v. 2.0.5) The dates look fine in the posts (Example, correctly translates January 29, 2007 to Enero 29, 2007)

    But...

    I added

    <?php echo date('j \d\e F, Y'); ?>

    in the header.php, near the <?php bloginfo('description'); ?>.

    My purpose is to show today's date in the header
    It still shows the date in English, not Spanish. I have changed the locale.php names from English to Spanish, I have the proper translation and .mo files.
    I also tried the setlocale & strftime options but it does not seem to work (sorry for the amateur terminology, I am not a php programmer)
    Am I overlooking something?
    My website is http://www.elchiricano.com I am using the blue Zinfadel 2.0 theme

    Thanks for your help and attention,

    Ricardo

  2. ortegara
    Member
    Posted 5 years ago #

    Alguien de habla hispana con este problema?

  3. ortegara
    Member
    Posted 5 years ago #

    Never mind, I solved it. Just to share:

    <?php setlocale(LC_TIME, "es_ES"); ?><?php echo strftime("%d de %B de %Y"); ?>

    Gave me "07 de febrero de 2007"

    echo date siempre va a poner la fecha en ingles, por lo visto.

Topic Closed

This topic has been closed to new replies.

About this Topic