Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
789 views
in Technique[技术] by (71.8m points)

timezone - How to change Heroku daylight saving setting

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

$ heroku config:set TZ=Europe/Berlin

You can see the valid zoneinfo names with:

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...