From The Blog

PHP - Ubuntu: supported locales

26 November 2013, in

1. First of all list supported locales:

cat /usr/share/i18n/SUPPORTED

2. Copy the locales for your region. I will copy the following lines:

sv_SE.UTF-8 UTF-8

sv_SE ISO-8859-1

3. Edit the list of 'supported locales' and paste your locales that you've copied. (See step above)

gedit /var/lib/locales/supported.d/local

 



Post a Comment

PHP: Problem getting date in different locale

26 November 2013, in

Have you ever faced a problem trying to get date in another locale ?

The way you can do it right is as follows:

You will use set setlocale(), strftime()

suppose you want to get the date in Italian

setlocale(LC_ALL, 'it_IT'); // Set locale to Italian

echo strftime("%e %B %Y"); //today's date

echo strftime("%e %B %Y",strtotime($date)); //another date



Post a Comment