P
P
pcdesign2019-02-03 10:37:41
Python
pcdesign, 2019-02-03 10:37:41

What is the best way in python3 to get a date like "February 3, 2019"?

>>> month_list = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня',
...            'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']

It's kind of like a collective farm.
Are there better options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-02-03
@kentuck1213

>>> locale.setlocale(locale.LC_TIME, 'ru_RU.UTF-8')
'ru_RU.UTF-8'
>>> datetime.now()
datetime.datetime(2019, 2, 3, 12, 44, 19, 396804)
>>> datetime.now().strftime('%B')
'февраля'

strftime.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question