FYI: date() doesn't respect the locale setting -- strftime() does. Using strftime() will give you the language-appropriate month and day names.
You can always call setlocale() just before calling strftime().
Quote from: BobRay at Sep 30, 2013, 09:34 AMFYI: date() doesn't respect the locale setting -- strftime() does. Using strftime() will give you the language-appropriate month and day names.
You can always call setlocale() just before calling strftime().
“When you know better you do better.”

P.S. Thanks for tip.
If we can really understand the problem, the answer will come out of it, because the answer is not separate from the problem.
J Krishnamurti
@tomek Thank you very much for this snipet. It is great solution for any language.
"Puno ti hvala, ovo je super stvar."
For me with MODX 2.3.3
locale in system settings > doesn't work
locale in context settings > doesn't work
Snippet :
<?php
$locale = $modx->context->getOption('locale', null, 'default');
setlocale(LC_ALL,$locale.'.UTF-8');
works fine ([[!setlocale]] call in header)
MODX lover
-
Développeur MODX / Webdesign / Solutions web
For me with MODX 2.3.5-pl
in "system settings > core > locale"
setting the value to "de_DE"
works fine for german language settings with strftime()