954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Displaying Just the Month with Datetime

I am still relatively new to Python and don't think I'm familiar/comfortable enough with my understanding of the datetime functions...
I want to take just the current month from the datetime function so I can use the number to send the string of the month (ex, datetime would give me 7 as the month, so I will tell it to output 'July') to another program as a shared variable but I cannot seem to figure out how to display just the month in Python. I got as far as using

datetime.date.today()


to get just the current year, month, and day but cannot seem to figure out how to narrow it down more.
Not sure if that was clear or not so please ask questions if you don't understand.

Thanks!

rhuffman8
Light Poster
30 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

You want datetime.date.strftime() (and follow the link for details)

griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: