如何更改Heroku夏令时设置 [英] How to change Heroku daylight saving setting

查看:132
本文介绍了如何更改Heroku夏令时设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以设法改变Heroku的时区,但仍然比当地时间少一小时。
任何人都可以帮助您设置Heroku上的DST(夏令时)偏移量吗?

I could manage to change time zone on Heroku but still it is giving one hour less than my local time. Can anyone help on how to set DST (daylight saving) offset on Heroku?

推荐答案

Heroku应用程序运行于正常的unix系统,并且你有所有的zoneinfo文件。我也相当肯定他们是最新的。

Heroku apps run on a normal unix system, and you have all the zoneinfo files there. I'm also fairly sure they're up-to-date.

就unix而言,你应该能够设置你的TZ env var类似于:

As far as unix goes, you should be able to set your TZ env var with something like:

$ heroku config:set TZ=Europe/Berlin

您可以看到有效的zoneinfo名称:

You can see the valid zoneinfo names with:

$ heroku run find /usr/share/zoneinfo/posix

然而,一般来说,您需要运行应用程序在UTC环境中,并在内部处理时区,可能会以每个用户为单位处理本地时间。

Generally speaking, though, you'll want to run your application on an UTC environment, and handle timezones internally, possibly handling local time on a user-per-user basis.

我怀疑这可能不会完全回答您的问题。您可能想要扩展您想要达到的目标以及您如何实现目标,以及您如何观察比本地小一小时的效果。

I suspect this may not entirely answer your question. You might want to expand on what exactly you're trying to achieve and how you're trying to achieve it, and also how you are observing the "one hour less than local" effect.

这篇关于如何更改Heroku夏令时设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆