Reputation: 181
It seems like i should be able to find some sort of documentation on this, but everything im finding isnt working. In Python (v. 3.3) how do you get the current time in HR:MIN:SEC format using the datetime module?
Upvotes: 1
Views: 177
Reputation: 8999
This should do it:
import datetime
now = datetime.datetime.now()
now.strftime('%H:%M:%S')
Other units of time can be found by using the directives found here.
Upvotes: 4