I am trying to output dates in the Italian format using date() as follows:
I found that setlocale isn't reliable, as it is set per process, not per thread (the manual mentions this). This means other running scripts can change the locale at any time. A solution is using IntlDateFormatter from the intl php extension.
$fmt = new \IntlDateFormatter('it_IT', NULL, NULL);
$fmt->setPattern('d MMMM yyyy HH:mm');
// See: http://userguide.icu-project.org/formatparse/datetime for pattern syntax
echo $fmt->format(new \DateTime());
If it doesn't work you might need to:
Install intl php extension (ubuntu example): sudo apt-get install php5-intl
Install the locale you want to use: sudo locale-gen it_IT