Skip to content

Instantly share code, notes, and snippets.

@nrk
Created August 18, 2009 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrk/169660 to your computer and use it in GitHub Desktop.
Save nrk/169660 to your computer and use it in GitHub Desktop.
>>> t1 = Time.new
=> Tue Aug 18 12:26:40 +02:00 2009
>>> t2 = Time.at(t1)
=> Tue Aug 18 12:26:40 +02:00 2009
>>>
>>> "t1: #{t1.object_id}"
=> "t1: 44"
>>> "t2: #{t1.object_id}"
=> "t2: 44"
>>>
>>> t1.object_id != t2.object_id
=> false
>>> t1.hash != t2.hash
=> false
irb(main):001:0> t1 = Time.new
=> Tue Aug 18 12:29:48 +0200 2009
irb(main):002:0> t2 = Time.at(t1)
=> Tue Aug 18 12:29:48 +0200 2009
irb(main):003:0>
irb(main):004:0* "t1: #{t1.object_id}"
=> "t1: 1335450"
irb(main):005:0> "t2: #{t2.object_id}"
=> "t2: 1321590"
irb(main):006:0>
irb(main):007:0* t1.object_id != t2.object_id
=> true
irb(main):008:0> t1.hash != t2.hash
=> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment