From: Zach Dennis Date: 2003-11-27T02:01:48+09:00 Subject: Re: Date Class and GMT Thank you very much Mark! Zach -----Original Message----- From: Mark J. Reed [mailto:markjreed@mail.com] Sent: Wednesday, November 26, 2003 11:47 AM To: ruby-talk ML Subject: Re: Date Class and GMT On Wed, Nov 26, 2003 at 04:39:45PM +0000, Mark J. Reed wrote: > On Thu, Nov 27, 2003 at 01:31:08AM +0900, Zach Dennis wrote: > > I need to be able to return the zone by it's numeric representation( > > i.e. -0500 ). Like Oh, it turns out that instead of using DateTime, you can just use the %z specifier to strftime. irb(main):001:0> n=Time.now => Wed Nov 26 11:41:51 EST 2003 irb(main):002:0> n.zone => "EST" irb(main):003:0> n.strftime("%Z") => "EST" irb(main):004:0> n.strftime("%z") => "-0500" irb(main):005:0> n.strftime("%a %b %d %H:%M:%S %z %Y") => "Wed Nov 26 11:41:51 -0500 2003" -Mark