Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

date in an other language????

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

date in an other language????

Postby kumschick » Tue Nov 25, 2003 4:48 pm

How can I get this translated into an other language?

$today = date("F j, Y");
//November 26, 2004

in french:
$today = date("F j, Y");
//Novembre 26, 2004
kumschick
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Nov 25, 2003 4:40 pm
Location: Luxembourg

Postby yK » Tue Nov 25, 2003 5:17 pm

this should work :

Code: Select all
<?

$month = Date(F);

function gofrench($month){

$frenchmonth = array(
   January => "Janvier",
   February => "Février",
   March => "Mars",
   April => "Avril",
   May => "Mai",
   June => "Juin",
   July => "Juillet",
   August => "Août",
   September => "Septembre",
   October => "Octobre",
   November => "Novembre",
   December => "Décembre"
);

$i = Date("j, Y");

$x = $frenchmonth[$month];

$f = $x." ".$i;

return $f;

}

print(gofrench($month));

?>


i havent tested it though
User avatar
yK
New php-forum User
New php-forum User
 
Posts: 28
Joined: Tue Aug 19, 2003 1:27 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.