[Tutor] Time problem

Kalle Svensson kalle@gnupung.net
Fri, 3 Aug 2001 02:08:57 +0200


Sez fleet@teachout.org:
> I'm quite happy with the three letter abbreviations for the months; but my
> client prefers to have them spelled out.  I can't find a way to do that in
> time module or the python docs.  Do I need to create a dictionary
> ({"Jan":"January"} etc.)?

Use %B instead of %b to strftime().

>>> import time
>>> time.strftime("%b %B", time.localtime())
'Aug August'

Peace,
  Kalle
-- 
Free Dmitry Sklyarov! - http://www.freesklyarov.org/