print date problem

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-19-2005
Bruintje Beer
 
Posts: n/a
Default print date problem

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


Reply With Quote
  #2 (permalink)  
Old 11-19-2005
vdP
 
Posts: n/a
Default Re: print date problem

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


Reply With Quote
  #3 (permalink)  
Old 11-19-2005
Bruintje Beer
 
Posts: n/a
Default Re: print date problem


"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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0