Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get date and time in python

from datetime import datetime

now = datetime.now().time().strftime("%H:%M:%S") # time object
date = datetime.now().strftime("%Y-%m-%d") # date object
print("date:",date)
print("time =", now)
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #date #time #python
ADD COMMENT
Topic
Name
7+5 =