GetSimple Support Forum
Spanish date - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Spanish date (/showthread.php?tid=329)



Spanish date - cumbe - 2010-01-23

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.


Spanish date - Zegnåt - 2010-01-23

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().


Spanish date - cumbe - 2010-01-23

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.


Spanish date - internet54 - 2010-01-24

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.


Spanish date - cumbe - 2010-01-24

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.


Spanish date - Zegnåt - 2010-01-25

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.


Spanish date - Nijikokun - 2010-01-25

es_MX, es_ES


Spanish date - cumbe - 2010-01-26

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


Spanish date - internet54 - 2010-01-26

Take a look at this and it my point you in a simple direction.
http://snipplr.com/view/3644/php--multiple-format-date-spanish/


Spanish date - cumbe - 2010-01-26

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.