php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34013 setlocale used from php-cli does not set locale
Submitted: 2005-08-05 20:56 UTC Modified: 2005-08-06 12:38 UTC
From: wim dot delvaux at adaptiveplanet dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.4 OS: debian sed
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wim dot delvaux at adaptiveplanet dot com
New email:
PHP Version: OS:

 

 [2005-08-05 20:56 UTC] wim dot delvaux at adaptiveplanet dot com
Description:
------------
setlocale used from apache module seems to work   
however using the same setlocale   
   
setlocale( LC_TIME, 'nl_NL' );   
   
in a php script started from the command line   
does not work (i.e. month names are not NL but remain EN   

Reproduce code:
---------------
<?php

    setlocale( LC_TIME, 'nl_NL' );

    print( date('F')."\n" );

?>

produces

August

and not

Augustus

Expected result:
----------------
Should output Augustus 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-05 21:00 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

And check that you have this locale first with:
locale -a | grep nl
 [2005-08-06 11:59 UTC] nlopess@php.net
The date() function doesn't work with locales. The month names are hardcoded in the sources.
I'm not sure if Derick will change this, but let him speak :)
 [2005-08-06 12:38 UTC] derick@php.net
date() never supported locale aware month names, use strftime() for that.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Dec 01 19:00:01 2025 UTC