GetSimple Support Forum

Full Version: Spanish date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!!

This is not a problem, but did not know where to put the post.

Is it possible to save the date of the page xml in spanish?.

In the web appears: "Publicado el January 17th, 2010". I want that it appears in spanish if it is possible.

I have been looking for ways to save it, but i have not found it.

Regards and thanks.
I believe GetSimple gets the date straight from your server. So you will have to tell your server to give back Spanish dates.

You can set the default language PHP returns its values in using setlocale().
I did not know it.

I have changed in /etc/php5/apache2/php.ini, the date.timezone= "Europe/Madrid", but continuous with the same.

Do you know what must be changed?

Thanks.
You need to change the default language of the server. You only changed the timezone which just changes the time printed out.

Or, you could create an array for the time to convert it to Spanish when printed.
Thanks internet54, but i do not find the way of changing the default language to the server apache.

I´m thinking in the array, but i have a little experience in this themes. I´ll try it.

REgards.
Or you use setlocale() as I mentioned …

Example:
Code:
setlocale(LC_ALL, 'nl_NL');
Will make all PHP output be Dutch. You just have to find and put in the language code for Spanish.
es_MX, es_ES
Yes Zegnåt. i have tried it too, but the result is the same.
I have created a php and several tests, and always the result is in english (:.

Code:
<?php

$Fecha_num="2007-08-12";

/* Windows con apache
setlocale(LC_TIME, 'Spanish'); */

/* Apache con linux */
/* setlocale(LC_TIME, 'es_ES'); */


// setlocale(LC_TIME, 'de_DE');
// echo strftime('%A, %d. %B %Y');  


/* setlocale(LC_TIME, 'es_MX'); */

setlocale(LC_TIME, 'es_ES');
echo $fecha=strftime('%d %B %Y',strtotime($Fecha_num));

?>

Regards

Edit: i have installed apache2-mpm-prefork
Take a look at this and it my point you in a simple direction.
http://snipplr.com/view/3644/php--multip...e-spanish/
Thanks Nijikokun.

Thanks one time more internet54.

This function must be used when the system getsimple saves the date in the page.xml, is this so?.

Regards.