datetime question

jyoung79 at kc.rr.com jyoung79 at kc.rr.com
Fri Mar 6 10:24:18 EST 2009


Just curious if this is the best way to get the first 3 letters of the current month?

>>> import datetime
>>> 
>>> d = datetime.date.today()
>>> m = d.strftime("%B")[:3].upper()
>>> m
'MAR'

Thanks.

Jay



More information about the Python-list mailing list