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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -