简体   繁体   中英

How to set app/server/Rack-wide timezone in Sinatra/Rack apps?

Is there a way to set the timezone for the entire Rack stack?

Ideally, I'd like one setting that can propagate to all middleware components, up to Sinatra, or whatever may be sitting on the front end of stack. Is the any way to do this? Bonus points for a solution that also works on Heroku.

Heroku uses UTC by default.

To change it you may be able to do heroku config:add TZ="Europe/Athens"

Though, this only addresses Heroku, the idea behind it (setting your local time on a server) should work just as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM