Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing month and date using python

I am trying to print only the month and date in python as following :

09-December
08-October

How could I do that?

like image 695
prudhvi Avatar asked Dec 15 '22 02:12

prudhvi


1 Answers

Try this

import datetime
now = datetime.datetime.now()
print now.strftime("%d-%B")

For more information on this : strftime

like image 154
Sankar Avatar answered Dec 31 '22 00:12

Sankar