python_reference/date_time.py
2014-03-06 10:54:02 -05:00

14 lines
248 B
Python

# Sebastian Raschka, 03/2014
# Date and Time in Python
import time
# print time HOURS:MINUTES:SECONDS
# e.g., '10:50:58'
print(time.strftime("%H:%M:%S"))
# print current date DAY:MONTH:YEAR
# e.g., '06/03/2014'
print(time.strftime("%d/%m/%Y"))