Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to return a date string in portuguese?

Status
Not open for further replies.

jordanpope

Programmer
Sep 23, 2003
21
BR
I am trying to return a date in the following format:

25 Setembro, 2003, 18:00

I have been trying to use setlocale as follows:

setlocale(LC_TIME, "pt_BR");

And return my date as follows:

$currDate = strftime("%e %B, %Y, %H:%M");

However, all this returns is 25 September, 2003, 18:52 ... where I am attempting to return 25 Setembro, 2003, 18:52 ...

Can someone please help?
 
I am running Apache/1.3.26 ... how can I determine if I have the locale available?
 
DRJ478:
As far as I can tell, he's invoking setlocale() correctly. The code:

Code:
<?php
setlocale(LC_TIME, &quot;pt_BR&quot;);

$currDate = strftime(&quot;%e %B, %Y, %H:%M&quot;);

print $currDate;
?>

Just output &quot;26 setembro, 2003, 12:33&quot; on my machine, a LAMP (RH9/1.3.27/4.0.14/4.33) box. But my LAMP box has a valid directory of /usr/share/locale/pt_BR.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
You are right. I skimmed the post - my mistake.
I tried in on my Windows XP machine, no luck.
Worked well on my Linux box, where I have the /usr/share/locale/.
PHP documentation points out for windows users:
Tip: Windows users will find usefull information about locale strings at Microsoft's MSDNwebsite. Supported language strings can be found here and supported country/region strings here. Windows systems support the three letter codes for country/region specified by ISO 3166-Alpha-3, which can be found at this Unicode website.
 
sleipnir214
I just tried that and in fact nothing happens. I also tried &quot;brazil&quot;. So, I guess then Mi¢ro$oft only takes US$?
 
I'm wondering if Win32 only has locales you've set up. On W2K, for example Control Panel / Regional Settings has all kinds of things to play with.

Or maybe it never occurred to M$'s programmers that someone might need more than one locale at a time.


Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top