Dates are easily constructed and formatted : Date Time « Development « Python






Dates are easily constructed and formatted

Dates are easily constructed and formatted

#Dates and Times


from datetime import date
now = date.today()
print now

print now.strftime("%m-%d-%y. %d %b %Y is a %A on the %d day of %B.")

          
       








Related examples in the same category

1.Use time structureUse time structure
2.Dates support calendar arithmeticDates support calendar arithmetic
3.Print out a date, given year, month, and day as numbersPrint out a date, given year, month, and day as numbers
4.Define your own class to store time and date
5.Define class to use system time class