Need help on Tmie#utc_offset

Hi,

I was reading this method
Class: Time (Ruby 2.0.0) and
trying to understand,but seems not working for me.

Follow the code:

irb(main):001:0> require ‘time’
=> true
irb(main):002:0>
irb(main):003:0* t1 = Time.now
=> 2013-09-27 19:42:21 +0530
irb(main):004:0> t2 = t1.utc
=> 2013-09-27 14:12:21 UTC
irb(main):005:0> t2.utc_offset
=> 0
irb(main):006:0> t1.utc_offset
=> 0
irb(main):007:0> t2.utc_offset - t1.utc_offset
=> 0
irb(main):008:0>

I am confused why I am getting 0,when I am applying #utc_offset?
Where did I wrong?

Am 27.09.2013 16:21, schrieb Love U Ruby:

irb(main):002:0>
irb(main):008:0>

I am confused why I am getting 0,when I am applying #utc_offset?
Where did I wrong?

Come on! You explicitly converted t1 to UTC…
(Note that according to the docs Time#utc modifies the receiver.)

Regards,
Marcus

unknown wrote in post #1122684:

Am 27.09.2013 16:21, schrieb Love U Ruby:
Come on! You explicitly converted t1 to UTC…
(Note that according to the docs Time#utc modifies the receiver.)

Regards,
Marcus

Ohh! I see…

irb(main):001:0> require ‘time’
=> true
irb(main):002:0> t1= Time.now
=> 2013-09-27 20:32:56 +0530
irb(main):003:0> t1.utc_offset
=> 19800
irb(main):004:0> t2= Time.now
=> 2013-09-27 20:33:44 +0530
irb(main):005:0> t2.utc_offset
=> 19800
irb(main):006:0>

Thanks for the pointer!