Link to home
Start Free TrialLog in
Avatar of mkag
mkag

asked on

setlocale & strftime

if I host following PHP script on Windows it is working fine i.e. output is  "Donnerstag, 04. Dezember 2003" as I want

setlocale(LC_TIME , 'de_DE@euro', 'de_DE', 'de', 'ge');
echo strftime("%A, %d. %B %Y");

But when I host it on Red Hat Linux output is following-

Thursday, 04. December 2003

Any help?
Avatar of shivsa
shivsa
Flag of United States of America image

because locale naming is different on redhat and windows.

try with
setlocale(LC_TIME , 'de@euro', 'de', 'de', 'ge');
also check if
language_country exists in the /usr/share/locale/locale.alias
Avatar of mkag
mkag

ASKER

not working
I don't have redhat, but check if the country is in /usr/share/locale/locale.gen, if not, it hasn't been generated.

The information was put across as Debian Related, and my server where I tested it is also Debian.

I don't know how it applies, if at all to RedHat.

What version of RedHat are you using?
You'll probably have to get the admin to install a de_DE locale RPM.
Avatar of mkag

ASKER

I have already installed it. I wrote a simple C program to test it. It was working fine but for PHP it is not working.

I have PHP 4.2

ASKER CERTIFIED SOLUTION
Avatar of shivsa
shivsa
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mkag

ASKER

thanks working