Results 1 to 4 of 4
Thread: date() function
-
03-11-2004, 06:14 PM #1Newbie
- Join Date
- Apr 2003
- Posts
- 22
printing date() function in spanish :(
Hello mates,
I need to print date(); function (PHP) in spanish.
Is it possible?
Could you help me please?
Thanks!
P.S.
Actually my code is:
PHP Code:<?php echo date('F j, Y'); ?>
Last edited by solid hoster; 03-11-2004 at 06:20 PM.
-
03-11-2004, 07:46 PM #2Newbie
- Join Date
- Aug 2003
- Location
- Barrie, ON, Canada
- Posts
- 6
Try this...
PHP Code:setlocale(LC_TIME,"spanish");
echo strftime ('%B %d, %Y');
Cheers
Richard
-
03-12-2004, 02:22 PM #3Newbie
- Join Date
- Apr 2003
- Posts
- 22
Thank you Richard!
-
03-13-2004, 05:49 AM #4Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 772
Hi Solid hoster,
As suggested by W-S-Nexus , You have to use setlocale function to print date according to your required format.
Here's the code which will print the date in spanish format
<?php
setlocale (LC_TIME,"spanish");
$long_date = str_replace("De","de",ucwords(strftime("%A, %d de %B de %Y")));
echo $long_date;
?>
For more details please refer the given below URL:
http://in2.php.net/manual/en/function.setlocale.php
Regards
Bright