Hi Daryl,

The Time.zone code only affects the behavior of Time.zone
(Time.zone.now, Time.zone.parse, ActiveRecord's casting of Date
columns, etc) inside your application; it doesn't have any effect on
system time (which is what `date` as well as Time.now will give you).
The best practice is to write your application to always use the
Time.zone.* functions to deal with times, and not make any assumptions
about the system time.

Mat

On Mon, May 3, 2010 at 01:30, Daryl <[email protected]> wrote:
> Hey there herokuistas,
>
> So, I'm using Rails 3.0.0.beta3 and am trying to get the default time
> in my app to be London while the servers, as you know, are on Pacific
> time (I'm in Aus myself).
>
> I've set the application_controller.rb to have a before filter which
> sets the timezone and then sets that to London (I still want AR to
> write to the DB in UTC, so have not touched the environment/
> application.rb).
>
> ===
>  before_filter :set_timezone
>
>  def set_timezone
>    Time.zone = 'London'
>  end
> ===
>
> Checking heroku console `date` *still* shows the machines on Pacific
> time, as does a check of the code when I got there (it should show
> Monday but instead stuck on Sunday at the mo).
>
> Can anyone tell me what I need to do to get the code to see this as
> London time ?
>
> Also, I've asked the fine folks at heroku to reset the daily cron to
> go off at 1.15am London time and just wondering if changing this
> setting to London time will then affect that daily cron job kicking
> off.
>
> Any help appreciated! A bit stumped here. Thanks !
> Daryl.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to