For example, on July 5, 2010, I would like to calculate the string
July 5, 2010
How should this be done?
For example, on July 5, 2010, I would like to calculate the string
July 5, 2010
How should this be done?
If you don't care about formatting and you just need some quick date, you can use this:
import time
print(time.ctime())
With time module:
import time
time.strftime("%B %d, %Y")
>>> 'July 23, 2010'
time.strftime("%I:%M%p on %B %d, %Y")
>>> '10:36AM on July 23, 2010'
For more formats: www.tutorialspoint.com