Change Time.now on server to return different timezone

I have an app deployed on a server where the system time is 7 hours behind UTC. I'm actually in England so I want times displayed in local time GMT (with daylight saving adjusted).

A gem that I'm using, resque, uses Time.now to retrieve the current time. What do I need to configure to get Time.now to return the correct time?

Answers


The easiest way would be to set the ENV["TZ"] variable.

> Time.now
=> 2011-05-21 13:13:23 +0200 
> ENV["TZ"] = "Europe/London"
=> "Europe/London"
> Time.now
=> 2011-05-21 12:13:55 +0100 

Need Your Help

Replacing statically referenced method in Java

java reflection methods static bcel

I have a class like below with a method that just returns a String, but I want to modify what it returns from another class, without hardcoding it myself.

javax.el.ELException: java.lang.NullPointerException

java jsf primefaces

I use primefaces single row selection data table , and i want to change a value on the selected row so this is my xhtml page

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.