2024-04-26 12:56:22 发布
网友
我只需要一个十进制系统来精确计算时间。在
所以我需要一个函数来返回时间戳的分钟数(对于时间戳,我的意思是1/1/1970)。在
它必须非常简单,相反,我从25分钟开始搜索!在
import time print(int(time.time() / 60)) 23078330
import datetime as DT def minutes(timestamp=None): """ Return integral number of minutes from the Epoch, 1970-1-1 """ if timestamp is None: now = DT.datetime.now() timestamp = now.timestamp() return timestamp//60 print(minutes())
相关问题 更多 >
编程相关推荐