2011-06-16, 03:36:40
Hi mvlcek,
I try to use the following:
and show:
I don't know why, but it doesn't work in servers that use. Always in english
.
Regards.
I try to use the following:
Code:
$dateLocale = 'de_DE,de,ger,deu'; // or use $LANG or a setting in your plugin,
// for OS compatibility multiple locales should be possible
$dateFormat = "%A, %d.%m.%Y - %H:%M"; // should be a entry in the i18n language file of your plugin
// for the format see PHP function strftime
$oldlocale = setLocale(LC_TIME, '0'); // save old locale
setlocale(LC_TIME, preg_split('/\s*,\s*/', $dateLocale));
echo strftime($dateFormat, $date).'<br />'; // $date is a UNIX timestamp
setLocale(LC_TIME, $oldlocale); // restore old locale
$Fecha_num="2011-06-15";
setlocale(LC_TIME, preg_split('/\s*,\s*/','es_ES'));
$fecha=strftime('%d %B %Y',strtotime($Fecha_num));
echo $fecha.'<br />';
and show:
Code:
Donnerstag, 01.01.1970 - 01:00
15 June 2011
I don't know why, but it doesn't work in servers that use. Always in english

Regards.