--- Rie! <[EMAIL PROTECTED]> wrote:

> Does anybody out there know how to change UTC to PST?
> 
> I've been banging my heads on the wall since yesterday and what I know
> is only set time to PST instead of UTC. Please help..
> 
> m:x arie$ script/console
> Loading development environment (Rails 2.0.2)
> >> Time.zone
> => #<TimeZone:0x211c608 @utc_offset=-28800, @name="Pacific Time (US &
> Canada)">
> >> Time.zone.now
> => Thu, 27 Mar 2008 03:37:05 PDT -07:00
> >> Time.now
> => Thu Mar 27 18:37:21 +0800 2008
> >> a = Time.now
> => Thu Mar 27 18:41:20 +0800 2008
> >> a.to_pst
> 
> I only need to show that "a" in PST instead of UTC. Any ideas?

i don't think I fully understand your question.
but displaying time in certain timezone is fairly easy (in UNIX-based system).

$ ruby -e'p Time.now'
Thu Mar 27 18:28:12 +0700 2008

$ env TZ="US/Pacific" ruby -e'p Time.now'
Thu Mar 27 04:27:29 -0700 2008

is that you are asking about? if so, then I have saved your head :-)

rgds,
Edwin.



      ________________________________________________________ 
Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi 
Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/

Kirim email ke