Python中Epoch-DateTime到字节数组的转换

2024-10-04 01:27:28 发布

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

我试图在python中将epoch datetime转换为字节数组 但它是10字节的,应该是4字节的。在

from time import time
curTime = int(time.time())
b = bytearray(str(curTime))
len(b)                 #comming as 10

我错了谁能帮忙吗


Tags: fromimportdatetimelen字节timeas数组