Debian is set to en_US
but I need day/month in German.
So how can I get %a
to output Do
instead of Thu
?
draw.text((0,34), time.strftime("%a %d.%m.%Y"), font=font)
Debian is set to en_US
but I need day/month in German.
So how can I get %a
to output Do
instead of Thu
?
draw.text((0,34), time.strftime("%a %d.%m.%Y"), font=font)
Linux
>>> import datetime
>>> import locale
>>> locale.setlocale(locale.LC_TIME, 'de_DE.UTF-8')
'de_DE.UTF-8'
>>> d = datetime.datetime.now()
>>> d.strftime("%a %d.%m.%Y")
'Do 24.05.2018'
>>>
You can use this code below and then just continue to use strftime:
import locale
# for German locale
locale.setlocale(locale.LC_TIME, "de_DE")
If you use windows, syntax change to:
locale.setlocale(locale.LC_ALL, 'deu_deu')