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?
相关问题
- How to specify memcache server to Rack::Session::M
- Connecting Python to a Heroku PostgreSQL DB?
- Display time in local timezone when querying Influ
- lon,lat to timezone
- VBA local timezone adjustment
相关文章
- Django/Heroku: FATAL: too many connections for rol
- Heroku Web Server Won't Start Locally
- Heroku push issue
- Why does Rake task enhancement differ between my l
- Push rejected, failed to detect set buildpack hero
- Email With Rails 3 and Heroku Net::SMTPSyntaxError
- TimeZoneInfo vs. Olson database
- Using AT TIME ZONE to get current time in specifie
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:
You can see the valid zoneinfo names with:
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.
I had a similar problem with php and DateTime() with a Symfony project at Heroku. I realized the time difference after the summertime daylight change in Central Europe. Even setting the timezone at heroku does not solve the problem:
$ heroku config:set TZ=Europe/Berlin
When i read out the phpinfo() at server-side the settings where UTC, so i decided to change the php.ini settings at Heroku. Here is an article from Heroku:
https://devcenter.heroku.com/articles/custom-php-settings#php-runtime-settings
By adding a .user.ini file to your web-root you can adapt the settings for your app. E.g. by adding the date.time setting:
date.timezone = Europe/Berlin
I know this is not the best solution for worldwide usage, but it works so far and my symfony app is only important for Central Europe now.