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 -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -