note 77401 added to function.strftime

From: Date: Tue, 28 Aug 2007 12:58:22 +0000
Subject: note 77401 added to function.strftime
Groups: php.notes 
Request: Send a blank email to php-notes+get-129851@lists.php.net to get a copy of this message
note, that for some languages you MUST set LC_ALL instead of LC_TIME. note that you further have to explicitly define your output-encoding (default is ISO-8859-1 [which makes problems for some languages])! at least i expirienced this behaviour on a german WinXP-PHP4 environment: <?php // does not work - gives question marks: setlocale(LC_TIME, 'RUS'); // ISO Alpha-3 is supported by xp echo strftime('%A', time()); ?> <?php // DOES work: header('Content-Type: text/html; charset=UTF-8'); // you could also use another charset here if iconv isn't installed on your system. echo setlocale(LC_ALL, 'RUS').': '; echo iconv('windows-1251', 'UTF-8', strftime('%A', time()))."\n"; ?> ---- Server IP: 81.223.48.75 Probable Submitter: 85.127.33.180 ---- Manual Page -- http://www.php.net/manual/en/function.strftime.php Edit -- https://master.php.net/note/edit/77401 Del: integrated -- https://master.php.net/note/delete/77401/integrated Del: useless -- https://master.php.net/note/delete/77401/useless Del: bad code -- https://master.php.net/note/delete/77401/bad+code Del: spam -- https://master.php.net/note/delete/77401/spam Del: non-english -- https://master.php.net/note/delete/77401/non-english Del: in docs -- https://master.php.net/note/delete/77401/in+docs Del: other reasons-- https://master.php.net/note/delete/77401 Reject -- https://master.php.net/note/reject/77401 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129851) next »