Trouble with setlocale("LC_TIME", "es_ES");

Hi

I need to show a date field in my data base in spanish. I have ste the code

<?php
setlocale(LC_TIME, 'es_ES');
?>

on my page.

The code to show the date field is:

<?php echo strftime("%A, %e %b %Y", strtotime($row_tb_dates['fecha'])); ?>

I get  Wednesday, 22 Dec 2004 instead of Miércoles, 22 de Dic 2004

Am I missing something?

Thanks

Cecilia
ceciliamtzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gruntarCommented:
Try this to see what will work on your server...

   $loc_es = setlocale (LC_ALL, 'es_ES', 'es');
   echo "Preferred locale on this system is '$loc_es'";

cheers
0
ceciliamtzAuthor Commented:
this is the output:

Preferred locale on this system is ''
0
gruntarCommented:
hm, not good. Try to add those values...

Spanish
es_ES.ISO8859-1
es_ES.utf-8

Cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

gruntarCommented:
This code did the trick on my mychine

setlocale(LC_TIME,'Spanish');
0
ceciliamtzAuthor Commented:
none of the values worked for me
could it be something at the server? maybe some modification to php.ini?
0
gruntarCommented:
Try this one
setlocale(LC_TIME,'Spanish_Spain');

or read official documentation http://si.php.net/manual/en/function.setlocale.php

cheers
0
ceciliamtzAuthor Commented:
got it working with

setlocale(LC_TIME, 'es_ES.ISO8859-1');

I don't know why the previous time it didn't work

Thanks a lot!!

Cecilia
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.