Jump to content

Change language setting date()


arbitter

Recommended Posts

I have a dutch site. For my pictures, I store them in directories made witht the date() function.

(you can check here: http://www.fransdepypere.be/uploads/uploads.php)

 

Now all the date() and stuff is in english. This is rather annoying because it's solely used for dutch purpose and dutch people. How do I change this? Do I have to contact my sitehost? Can you change this in 'DirectAdmin'?

 

It's my first site, first webhostingexperience, so try to explain clear...

Link to comment
Share on other sites

Problem;

 

the setlocale() works fine, but I get problems for example here:

echo strftime("%A %e %B %C");

 

%A means the day in full

%e means the day in numbers

%B means the month in full

%C means the year in 2 last numbers

 

Yet when I echo it, I solely get the daty in full and the month in full...

Link to comment
Share on other sites

Thanks a lot, I'll try that out, seems pretttty difficult to me though :P

 

in the first example it's:

setlocale(LC_ALL, 'nl_NL');

 

in the second, windows example, it's:

setlocale(LC_ALL, 'nld_nld');

 

If you are using a web hosting provider, You are most likely using a Linux based version of Apache (Most websites use CentOS or Fedora, Not many use Windows), so you'd naturally use:

 

setlocale(LC_ALL, 'nl_NL');
echo strftime("%A"); //May say: Zondag

 

You can look at the manual of strftime to create custom dates.

Link to comment
Share on other sites

Problem is that not all my variables get through (as I dictated in my last  post). Anyone any help on this?

 

edit: my bad; isn't possible:

 

Not all conversion specifiers may be supported by your C library, in which case they will not be supported by PHP's strftime(). Additionally, not all platforms support negative timestamps, so your date range may be limited to no earlier than the Unix epoch. This means that %e, %T, %R and, %D (and possibly others) - as well as dates prior to Jan 1, 1970 - will not work on Windows, some Linux distributions, and a few other operating systems.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.