PHP – Ubuntu: supported locales


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   4. Finely generate your locales dpkg-reconfigure locales

PHP: Problem getting date in different locale


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 … Continue reading PHP: Problem getting date in different locale