I am trying to access to time.ctime()
do some simple logical operations. I found this procedure :
datetime.datetime.strptime(time.ctime(), "%a %b %d %H:%M:%S %Y")
What gives me this:
datetime.datetime(2017, 10, 5, 17, 7, 51)
How can I access the time.ctime()
date and time separately so that I can get:
datetime.date(2017, 10, 5)
and
datetime.time(17, 7)
source
share