From: zunda Date: 2004-12-01T14:30:56+09:00 Subject: Re: Timezone Adjustment? Hi, > "displaying" > the date/time from a database and justing it for the a users local > timezone in a web application. > > Is there a simple way of doing this? What I have been doing is to play with the environment variable TZ: t = Time.now ENV['TZ'] = 'HST' puts t.localtime #=> Tue Nov 30 19:25:55 HST 2004 ENV['TZ'] = 'Japan' u = Time.at( t ) puts t.localtime #=> Tue Nov 30 19:25:55 HST 2004 puts u.localtime #=> Wed Dec 01 14:25:55 JST 2004 It seems that we have to create a new Time object to change timezone. I also like to know more sofisticated ways to do this. Thanks, zunda __________________________________ STOP HIV/AIDS. Yahoo! JAPAN Redribbon Campaign http://pr.mail.yahoo.co.jp/redribbon/