python时间(毫秒)计算

2024-04-25 19:51:33 发布

您现在位置:Python中文网/ 问答频道 /正文

如何计算毫秒,从下面的代码。

a = datetime.datetime.now()
b = datetime.datetime.now()
c = b - a

>>> c

>>> c.days
0
>>> c.seconds
4
>>> c.microseconds

Tags: 代码datetimedaysnowsecondsmicroseconds