# 01 데이트타임 라이브러리(datetime Library)
brian = "Always look on the bright side of life!"
# 02 현재 시간과 날짜 가져오기
from datetime import datetime
now = datetime.now()
print (now)
2017-01-27 10:34:01.770067
# 03 정보 추출하기
now = datetime.now()
print (now.year)
print (now.month)
print (now.day)
2017 1 27
# 04 날짜 정보 다듬기
now = datetime.now()
print (str(now.month) + "/" + str(now.day) + "/" + str(now.year))
1/27/2017
# 05 시간 정보 다듬기
now = datetime.now()
print (str(now.hour) + ":" + str(now.minute) + ":" + str(now.second))
#print (str(now.month) + "/" + str(now.day) + "/" + str(now.year))
10:34:1
# 06 마무리
now = datetime.now()
print (str(now.month) + "/" + str(now.day) + "/" + str(now.year), str(now.hour) + ":" + str(now.minute) + ":" + str(now.second))
1/27/2017 10:34:1
now
datetime.datetime(2017, 1, 27, 10, 34, 1, 832164)