Get up to milliseconds with python
from datetime import datetime as dt now = dt.now() print now.strftime("%Y%m%d%H%M%S.") + "%04d" % (now.microsecond // 1000)