Problem is, the current user’s time zone will leak across to the next request on the same thread. If the next one is by a logged-out user, all times displayed on that next request will show in the first user’s time zone.

You might be tempted to combine the first two lines of set_time_zone into one line with the comma assignment syntax and add “if logged_in?” to the one line in the ensure clause. Don’t do it. If you did that, the user’s time zone would leak out to the next request when the user logs out.

Hi Brian, I’ve been trying to set Time.zone directly as in: Time.zone=’CST’, I still get UTC if i check Time.zone. Time.now is in CDT and Time.now.zone is CDT. I’ve also tried Time.zone=Time.now.zone, yet Time.zone still yields UTC. Not sure what to make of all this. My goal is to set the local timezone so I can correctly test a controller action which converts a stored UTC date into a displayable local time – otherwise my test only passes in one timezone!