python datetime

import datetime

nowtime = datetime.datetime.now()

nowtime.strftime("%Y-%m-%d %H:%M:%S.") + str(nowtime.microsecond)

原文地址:https://www.cnblogs.com/zhaocundang/p/11082331.html