Closed mostafaasadi closed 6 years ago
@mostafaasadi it's because the months setting is configured during init
you mean if I get 11 from 1396-11-29 and int it (int())
, I can get name of month as persian ?
how ?
The locale should be set before jdatetime object is created
In [1]: import locale
In [2]: import jdatetime
In [3]: date1 = jdatetime.datetime.now()
In [4]: date1.strftime('%d %B')
Out[4]: u'30 Bahman'
In [5]: locale.setlocale(locale.LC_ALL, 'fa_IR.UTF-8')
Out[5]: 'fa_IR.UTF-8'
In [6]: date1.strftime('%d %B')
Out[6]: u'30 Bahman'
In [7]: date2 = jdatetime.datetime.now()
In [8]: date2.strftime('%d %B')
Out[8]: u'30 \u0628\u0647\u0645\u0646'
`
thank you, I ll test it.
thank you brother, it works :rose:
Hi I have this :
and outout is :
my problem is about
jdt2
that wont change bahman to بهمن is it my fault ? or a problem in lib ? thank you 🌹