Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

setlocale & strftime

Posted on 2003-12-03
8
Medium Priority
?
650 Views
Last Modified: 2013-12-13
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?
0
Comment
Question by:mkag
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9872594
because locale naming is different on redhat and windows.

try with
setlocale(LC_TIME , 'de@euro', 'de', 'de', 'ge');
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9872607
also check if
language_country exists in the /usr/share/locale/locale.alias
0
 

Author Comment

by:mkag
ID: 9873109
not working
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:aolXFT
ID: 9877801
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?
0
 
LVL 6

Expert Comment

by:aolXFT
ID: 9877853
You'll probably have to get the admin to install a de_DE locale RPM.
0
 

Author Comment

by:mkag
ID: 9880432
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

0
 
LVL 24

Accepted Solution

by:
shivsa earned 750 total points
ID: 9880493
could u try this.

putenv("LANG=de_DE");
putenv("LANGUAGE=de_DE");
putenv("LC_ALL=de_DE");
setlocale(LC_ALL, "de_DE", "german");
setlocale(LC_TIME , 'de_DE@euro', 'de_DE', 'de', 'ge');
echo strftime("%A, %d. %B %Y");



0
 

Author Comment

by:mkag
ID: 9881748
thanks working
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question