To get a date string with milliseconds (3 decimal places behind seconds), use this:
from datetime import datetime
print datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
>>>> OUTPUT >>>>
2020-05-04 10:18:32.926
Note: For Python3, print
requires parentheses:
print(datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…