mirror of
https://github.com/rasbt/python_reference.git
synced 2024-12-18 16:20:19 +00:00
14 lines
248 B
Python
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"))
|