Convert numerical based date to alphabetical based in Python -
i have following date
from datetime import datetime test = datetime(2015,9,8) which looks this:
in [18]: type(test) out[18]: datetime.datetime in [19]: print test 2015-09-08 00:00:00 what want convert
2015-09-08 into
sept8 basically pick first 4 letter of each month , append date. how can achieve that?
this should work , uses localization of system:
test.strftime("%b")[:4] + str(test.day)
Comments
Post a Comment