# Hosting timezone differs of clients timezone

**URL:** <https://www.ruby-forum.com/t/hosting-timezone-differs-of-clients-timezone/63732>\
**Category:** Rails\
**Created:** [June 18, 2006, 1:42pm UTC](https://www.ruby-forum.com/t/hosting-timezone-differs-of-clients-timezone/63732 "2006-06-18T13:42:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosparamio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@carlosparamio](https://www.ruby-forum.com/u/carlosparamio)\
**Post date:** [June 18, 2006, 1:42pm UTC](https://www.ruby-forum.com/t/hosting-timezone-differs-of-clients-timezone/63732/1 "2006-06-18T13:42:49Z")

</div>

Hi,

I have a website in production wich uses a lot of date and time  
calculations to show specific information.

The timezone of my hosting service (Dreamhost) is PDT, and the timezone  
of my potential clients is CEST. There are 9 hours of difference between  
them.

Is there an environment variable that I could adjust in my rails  
application, so all date/time values be set to CEST timezone?

## Thanks.

Carlos Alberto Paramio Danta .–.  
[http://www.sinfoniadebits.com/](http://www.sinfoniadebits.com/) |o\_o |  
email : carlosparamio @ [gmail.com](http://gmail.com) |:\_/ |  
jabber: parax @ jaim.at // \   
----------------------------------------( | | )–  
Fingerprint 41C6 D2BE 7DE7 AB61 C23F /'\_ _/`  
F697 5A1D 1849 01B8 D318 \_**)=(**_/

---

<div class="post-metadata">

**Author:** ![carlosparamio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@carlosparamio](https://www.ruby-forum.com/u/carlosparamio)\
**Post date:** [June 18, 2006, 3:59pm UTC](https://www.ruby-forum.com/t/hosting-timezone-differs-of-clients-timezone/63732/2 "2006-06-18T15:59:41Z")

</div>

Carlos P. wrote:

> I have a website in production wich uses a lot of date and time  
> calculations to show specific information.
> 
> The timezone of my hosting service (Dreamhost) is PDT, and the timezone  
> of my potential clients is CEST. There are 9 hours of difference between  
> them.
> 
> Is there an environment variable that I could adjust in my rails  
> application, so all date/time values be set to CEST timezone?

Set the TZ environment variable in your config/environment.rb file.  
E.g.:

ENV[‘TZ’] = ‘Europe/Madrid’

The allowed values for TZ can be found by looking in the  
/usr/share/zoneinfo directory.

–  
Philip R.  
[http://tzinfo.rubyforge.org/](http://tzinfo.rubyforge.org/) – DST-aware timezone library for Ruby

---

<div class="post-metadata">

**Author:** ![carlosparamio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@carlosparamio](https://www.ruby-forum.com/u/carlosparamio)\
**Post date:** [June 21, 2006, 7:51am UTC](https://www.ruby-forum.com/t/hosting-timezone-differs-of-clients-timezone/63732/3 "2006-06-21T07:51:33Z")

</div>

Philip,

It worked like a charm. Thanks a lot!

Philip R. escribiÃ³:

> Set the TZ environment variable in your config/environment.rb file. E.g.:
> 
> ENV[‘TZ’] = ‘Europe/Madrid’
> 
> The allowed values for TZ can be found by looking in the  
> /usr/share/zoneinfo directory.

–  
Carlos Alberto Paramio Danta .–.  
[http://www.sinfoniadebits.com/](http://www.sinfoniadebits.com/) |o\_o |  
email : carlosparamio @ [gmail.com](http://gmail.com) |:\_/ |  
jabber: parax @ jaim.at // \   
----------------------------------------( | | )–  
Fingerprint 41C6 D2BE 7DE7 AB61 C23F /'\_ _/`  
F697 5A1D 1849 01B8 D318 \_**)=(**_/
