在python中为unix时间戳添加小时数 [英] Adding hours to unix time stamp in python
本文介绍了在python中为unix时间戳添加小时数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要为某个 Unix 时间戳添加 5 小时.它就像游戏的开始和停止时间.所以我知道比赛的开始时间和持续时间.我需要把结束时间.这如何在 python 中完成?
I need to add 5 hours to a certain unix time stamp. Its like start and stop time for a game. So I have the knowledge of start time and the duration of the game. I need to put end time. How this can be done in python?
推荐答案
UNIX 时间戳以秒为单位.
UNIX timestamps are in second units.
end_timestamp = start_timestamp + 5 * 60 * 60
这篇关于在python中为unix时间戳添加小时数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文