This is a discussion on print date problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, I have some problems displaying the date in my own language (dutch). If tried the ones below but the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I have some problems displaying the date in my own language (dutch). If tried the ones below but the date is always printed in english. My date and country settings in windows are ok, in windows it is displayed in the dutch language. So what am I doing wrong. setlocale(LC_TIME, 'nl_NL'); setlocale(LC_TIME, "dutch"); setlocale(LC_TIME, "nld"); print date("l j F Y"); // should print : zaterdag 19 november 2005 John |
|
|||
|
Bruintje Beer wrote:
> Hi, > > I have some problems displaying the date in my own language (dutch). If > tried the ones below but the date is always printed in english. My date and > country settings in windows are ok, in windows it is displayed in the dutch > language. So what am I doing wrong. > > setlocale(LC_TIME, 'nl_NL'); > setlocale(LC_TIME, "dutch"); > setlocale(LC_TIME, "nld"); > > print date("l j F Y"); // should print : zaterdag 19 november 2005 > > John Unfortunately you can't use date() to print a date in dutch. Instead you should use strftime: print strftime("%A %#d %B %Y"); //prints: zaterdag 19 november 2005 You can use a timestamp as a second argument of strftime if you want to print a date other than today. For more details see http://nl3.php.net/manual/en/function.strftime.php vdP |
|
|||
|
"vdP" <hvdploeg_NO_SPAM@wanadoo.nl> schreef in bericht news:437f1f62$0$75458$dbd49001@news.wanadoo.nl... > Bruintje Beer wrote: >> Hi, >> >> I have some problems displaying the date in my own language (dutch). If >> tried the ones below but the date is always printed in english. My date >> and country settings in windows are ok, in windows it is displayed in the >> dutch language. So what am I doing wrong. >> >> setlocale(LC_TIME, 'nl_NL'); >> setlocale(LC_TIME, "dutch"); >> setlocale(LC_TIME, "nld"); >> >> print date("l j F Y"); // should print : zaterdag 19 november 2005 >> >> John > > Unfortunately you can't use date() to print a date in dutch. Instead you > should use strftime: > > print strftime("%A %#d %B %Y"); //prints: zaterdag 19 november 2005 > > You can use a timestamp as a second argument of strftime if you want to > print a date other than today. For more details see > http://nl3.php.net/manual/en/function.strftime.php > > vdP > > Thanks, this works John |
![]() |
| Thread Tools | |
| Display Modes | |
|
|