F
Farrel Lifson
I'm running Ruby 1.8 on XP (ruby 1.8.1 (2003-12-25) [i386-mswin32]).
Currently Time#zone returns a long form of the timezone for me :
irb(main):001:0> Time.now.zone
=> "South Africa Standard Time"
On Linux (ruby 1.8.1 (2004-05-02) [i686-linux-gnu]) I get the
shortened time zone code which is what I would like to get on XP:
irb(main):001:0> Time.now.zone
=> "SAST"
I've looked through Time#methods and I can't see a way to get the
shortened code on XP without doing some processing on the result
(probably just get the first letter of every word) which is not
something I'd like to do as the script will be run on both Linux and
XP and I'd like to have it as clean as possible with no OS specific
exceptions.
Thanks,
Farrel
Currently Time#zone returns a long form of the timezone for me :
irb(main):001:0> Time.now.zone
=> "South Africa Standard Time"
On Linux (ruby 1.8.1 (2004-05-02) [i686-linux-gnu]) I get the
shortened time zone code which is what I would like to get on XP:
irb(main):001:0> Time.now.zone
=> "SAST"
I've looked through Time#methods and I can't see a way to get the
shortened code on XP without doing some processing on the result
(probably just get the first letter of every word) which is not
something I'd like to do as the script will be run on both Linux and
XP and I'd like to have it as clean as possible with no OS specific
exceptions.
Thanks,
Farrel