Alex Rivera | Logout

How do I get the current time in milliseconds in Python?

Asked 2011-05-13T22:02:54.457
837

How do I get the current time in milliseconds in Python?

Edit
Report

1 Answer

96

time.time() may only give resolution to the second, the preferred approach for milliseconds is datetime.

from datetime import datetime
dt = datetime.now()
dt.microsecond
answered 2012-11-02T17:26:33.910

Your Answer