Date and Time

Lesson 01/06 – The datetime Library

 
from datetime import datetime

Lesson 02/06 – Getting the Current Date and Time

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

Lesson 03/06 – Extracting Information

 
from datetime import datetime
now = datetime.now ()
print now
print now.month
print now.day
print now.year

Lesson 04/06 – Hot Date

 
from datetime import datetime
now = datetime.now ()
print now
print now.month
print now.day
print now.year
print str(now.month) + str("/") + str(now.day) + str("/") + str(now.year) 

Lesson 05/06 – Pretty Time

 
from datetime import datetime
now = datetime.now ()
print now
print now.month
print now.day
print now.year
print str(now.month) + str("/") + str(now.day) + str("/") + str(now.year) 
print str(now.hour) + str(":") + str(now.minute) + str(":") + str(now.second) + str(":")

Lesson 06/06 – Grand Finale

 
from datetime import datetime
now = datetime.now ()
print now
print now.month
print now.day
print now.year
print str(now.month) + str("/") + str(now.day) + str("/") + str(now.year) 
print str(now.hour) + str(":") + str(now.minute) + str(":") + str(now.second)
print str(now.month) + str("/") + str(now.day) + str("/") + str(now.year) + " " + str(now.hour) + str(":") + str(now.minute) + str(":") + str(now.second)