--- Rie! <[EMAIL PROTECTED]> wrote: > On 27/03/2008, Edwin Pratomo <[EMAIL PROTECTED]> wrote: > > > 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 :-) > > No, what I want to get is only displaying what current UTC Time to be > PST instead of also UTC. BTW my server is already UTC and I *don't* > want to change its setting to be PST. Just imagine this scenario, one > day a customer will say: "We need it to be based by Europe Paris > instead of PST"
my answer didn't suggest you to change timezone. if you run it, your timezone is not affected. and of course you can polish it into .to_pst or something by doing the env setting temporarily. about that Europe Paris or anywhere else, of course you can pick the timezone list on your (POSIX) system. mine is in /usr/share/zoneinfo rgds, Edwin > > [EMAIL PROTECTED] [~]# date > Thu Mar 27 11:43:32 UTC 2008 > > I need to display something like if I say: Time.now.to_pst , will show > PST, not UTC. > > I've read jamisbuck's post about tzinfo about deprecated and obsolete, > and also rick's posts of Time.zone.now but I have no idea how to *get* > Pacific Time (US & Canada) Time, I only know how to _set_ it. I even > read one of jamisbuck blog comments saying that time and date > implementation in Ruby should be changed # Nope, I'm not saying > current implementation is good nor bad, I'm just frustrated I guess > :(( > > My heads are still bleeding. > > Help... > > > rgds, > > Edwin. > > -- > blog: http://tinyurl.com/2bjgvn, > ruby: http://www.ruby-lang.org/id/about > > I always thought Smalltalk would beat Java, I just didn't know it > would be called 'Ruby' when it did. -- Kent Beck. > ________________________________________________________ Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/

