python_reference/howtos_as_py_files/date_time.py
2014-04-29 22:28:50 -04: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"))