Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
July 31, 2014, 05:45:07 PM

Pages: [1]   Go Down
  Print  
Author Topic: Spanish date() format  (Read 6554 times)
rbrummett
Spacescooter Operator
*****
Offline Offline

Posts: 47



WWW
« on: December 14, 2009, 09:23:03 PM »

I have  a script that correctly posts the date a post was made in English. What do I need to modify so that the date shows in Spanish (i.e. day and month)?
Logged

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
http://www.divinecomics.com
http://es.divinecomics.com
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5855



« Reply #1 on: December 15, 2009, 07:10:52 AM »

Many "canned" applications (forums, etc.) have an administrative function to give the format of a date output. For example, in SMF if you want dates to show as dd.mm.yyyy the format might be something like %d.%m.%Y. If you have written your own application, does it use the PHP date("format string", time()) function to format the date? If so, the format string would be "d.m.Y". Other applications might depend on the server's default settings LC_* or language environment variable (e.g., $LANG = es_ES). In that case, you may or may not be able to change such things. If not, the code may need to be modified to use a format string that the administrator and users can override. It all depends on what language the application is written in.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
rbrummett
Spacescooter Operator
*****
Offline Offline

Posts: 47



WWW
« Reply #2 on: December 15, 2009, 02:55:43 PM »

Well then I guess I would need the Spanish format installed in language settings. Where can I find out if Spanish is an alternate language installed in PHP v5 on this site?
Logged

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
http://www.divinecomics.com
http://es.divinecomics.com
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5855



« Reply #3 on: December 15, 2009, 04:03:15 PM »

http://us2.php.net/manual/en/function.gettext.php and http://us2.php.net/manual/en/function.setlocale.php show examples of setting up PHP's language environment. Hopefully that will help you get your application using Spanish formats and text, or at least get you pointed in the right direction.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
Pages: [1]   Go Up
  Print  
 
Jump to: