note 15426 added to function.strftime

From: Date: Mon, 10 Sep 2001 10:02:56 +0000
Subject: note 15426 added to function.strftime
Groups: php.notes 
Request: Send a blank email to php-notes+get-17868@lists.php.net to get a copy of this message
Note that setting LC_TIME is not enough for some locales under Windows, e.g. Czech, because there are some characters not contained in default (US) character set like 'è' (c with hook), 'ø' (r with hook). If you run Apache as regular application and have set your locale to Czech (ControlPanel/RegionalOptions), there is no problem and 'September' is correctly translated as 'záøí', 'Thursday' as 'ètvrtek'. But if you run Apache as service, you get 'zárí', and 'ctvrtek'. To get things work as you expect you must set LC_CTYPE beside LC_TIME, or set LC_ALL. <? $locale = 'Czech_Czech.1250'; $res = setlocale( 'LC_CTYPE', $locale); //important $res = setlocale( 'LC_TIME', $locale); echo strftime( '%A %m. %B %Y', mktime( 0,0,0,9,6,2001)); ?> http://www.php.net/manual/en/function.strftime.php

« previous php.notes (#17868) next »