Reputation: 5552
I'm trying to access time.ctime()
in order to make some simple boolean operations. I found this procedure:
datetime.datetime.strptime(time.ctime(), "%a %b %d %H:%M:%S %Y")
Which gives me this:
datetime.datetime(2017, 10, 5, 17, 7, 51)
How can I access time.ctime()
date and time separate so I could get:
datetime.date(2017, 10, 5)
and
datetime.time(17, 7)
Upvotes: 4
Views: 125