Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们如何计算自一天开始以来经过的秒数 0.00 ?有模块功能还是我们必须自己做?
from datetime import datetime, time now = datetime.now() beginning_of_day = datetime.combine(now.date(), time(0)) print (now - beginning_of_day).seconds
请参阅此处datetime的模块文档。
datetime