Forum Support

Shape 5
March 28, 2024, 07:44:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Date in header for non-english  (Read 468 times)
albigin
Jr. Member
**
Offline Offline

Posts: 3



« on: October 04, 2007, 12:30:14 AM »

Hi,

   I have userchoice happily running on a Joomla! 1.5.

   But there's an issue: I'm using a non-english language and I can't have the date on the left hand size of the header in my language: it only comes out in english i.e. "October 4, 2007".

So I looked for a workaround and found following: in index.php of the template around line 1000 I changed to:

<div style="float:left; margin-right: 10px;">
<?php $today = date("j m Y"); PRINT "$today";?>
</div>

Pb. is that if I set m to M the month's name comes out in english! I want it in italian (this is the default language of my site). Any suggestion?

Thx
Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #1 on: October 04, 2007, 07:23:49 AM »

This should work for you.

Just delete:

<?php $today = date("j m Y"); PRINT "$today";?>

and replace it with:


<?php

setlocale(LC_TIME, "it_IT");
echo strftime(" %B");

$today = date(" j, Y"); PRINT "$today";

?>


The setlocale(LC_TIME, "it_IT"); tells it Italy as the locale and %B is the format of the month. If you want to play around with any of the formats here's a list of php date options:

http://us3.php.net/manual/en/function.strftime.php

Hope that helps!

Regards,
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.