How to change Heroku daylight saving setting

后端 未结 2 537
不知归路
不知归路 2021-01-24 04:42

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?

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-24 05:22

    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.

提交回复
热议问题