我使用python的time模块来转换time_struct和时间戳:
mktime(gmtime(1404144000))
结果是:
1404115200.0
谁能告诉我为什么?
最佳答案
mktime()
是 localtime()
的倒数,而不是 gmtime()
要获取 gmtime()
的倒数,请参阅以下问题:
Is there an inverse function for time.gmtime() that parses a UTC tuple to seconds since the epoch?
关于python - 谁能告诉我为什么我在 python 中使用 gmtime 和 mktime 得到错误的结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25160171/