Page 1 of 1
Days of week in other language !!
Posted: Fri Aug 29, 2003 8:13 pm
by liviu
Hy, can someone help me with this problem ?
I whant to show on my site the name of the days in a week (Monday etc.) in my own language (romanian). Right now i get this by using the date() function. Can i translate the output of this function ?
Thanks in advance...
Posted: Fri Aug 29, 2003 8:27 pm
by JAM
You could try using
setlocale().
Posted: Fri Aug 29, 2003 8:29 pm
by qads
Code: Select all
<?php
/*
to translate a date on a another language use this function (this example translates days and months on Polish- niedziela,poniedzialek...styczen,luty...):
Author: Peter Skalecki
http://www.petersoft.prv.pl
petersoft@wp.pl
Use:
print(DataPL("l, j F Y, G:i:s"));
*/
Function DataPL( $TwojaData )
{
$dzien[0] = "Niedziela";
$dzien[1] = "Poniedzialek";
$dzien[2] = "Wtorek";
$dzien[3] = "Sroda";
$dzien[4] = "Czwartek";
$dzien[5] = "Piatek";
$dzien[6] = "Sobota";
$miesiac[1] = "Styczen";
$miesiac[2] = "Luty";
$miesiac[3] = "Marzec";
$miesiac[4] = "Kwiecien";
$miesiac[5] = "Maj";
$miesiac[6] = "Czerwiec";
$miesiac[7] = "Lipiec";
$miesiac[8] = "Sierpien";
$miesiac[9] = "Wrzesien";
$miesiac[10] = "Pazdziernik";
$miesiac[11] = "Listopad";
$miesiac[12] = "Grudzien";
$TwojaData = str_replace( "l", "|.|.|", $TwojaData);
$TwojaData = str_replace( "F", "|,|,|", $TwojaData);
$TwojaData = date($TwojaData);
$TwojaData = str_replace( "|.|.|", $dzien[date("w")], $TwojaData);
$TwojaData = str_replace( "|,|,|", $miesiac[date("n")], $TwojaData);
return($TwojaData);}
?>
you can find lots of things..only if you read the php manual

Posted: Fri Aug 29, 2003 8:49 pm
by liviu
Thanks, i realy could not find this kind of information on PHP Manual, or... i did not look where i should....
