_locale emulation only supports "C" locale

"[email protected]" <[email protected]>
Newsgroups gmane.comp.lang.jython.user
Message-ID <[email protected]>
I am using a Windows computer with Chinese locale. I can format datetime object with Chinese abbreviated month name:

>>> t = datetime.datetime(2015,11,2) 
>>> print unicode(t.strftime('%Y%b%d')) 
2015十一月02

Now I want to get English abbreviated month name (2015sep02), so I tyied blow code:

import locale 
locale.setlocale(locale.LC_ALL, 'en_US') 
t = datetime.datetime(2015,11,2) 
print t.strftime('%Y%b%d')

But I got erro message: ValueError: _locale emulation only supports "C" locale

How to solve this problem? I am using Jython 2.7.0 library.

Regards
Yaqiang


*************************************************
Dr. Yaqiang Wang
Chinese Academy of Meteorological Sciences (CAMS)
46, Zhong-Guan-Cun South Avenue
Beijing, 100081
China
             
[email protected]

http://www.meteothinker.com
**************************************************

------------------------------------------------------------------------------

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.