Skip to main content
 首页 » 编程设计

python之在 Python 中将 UNIX 时间戳转换为非本地时间

2025年05月04日9虾米姐

我是 Python 新手。我想出了如何将 UNIX 时间转换为本地时间,但我不知道如何转换为不同的时区(夏令时的中部时间)。有人可以帮忙吗?

请您参考如下方法:

您可以使用 time.tzset。 documentation提供了一些设置 TZ 环境变量的好例子。