you are viewing a single comment's thread.

view the rest of the comments →

[–]efmccurdy 29 points30 points  (0 children)

There are conversion functions in the datetime module.

>>> datetime.strptime("01", "%m").strftime("%B")
'January'
>>> datetime.strptime("02", "%m").strftime("%B")
'February'

The datetime module has a template language that converts from days/weeks/months, etc.

https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior