S
siemenbaader
Hi,
I stumbled across some odd behavior when using Time.parse. Apparently
<=> fails on Time objects generated by Time.parse when the compared
require 'time'
=> true
As Time#inspect is overridden i don't know how to examine if there are
any differences between the objects created with parse and dup
respectively...
Is this known? Is it a bug or do I misunderstand something?
I could not find it mentioned in the bugtracker or on the 'net with
google.
- Siemen Baader
I stumbled across some odd behavior when using Time.parse. Apparently
<=> fails on Time objects generated by Time.parse when the compared
=> "1.8.4"objects are equal. The parsed object appears smaller to said:VERSION
require 'time'
=> true
=> Tue Apr 10 15:42:40 CEST 2007t = Time.now
=> Tue Apr 10 15:42:40 CEST 2007tt = t.dup
=> Tue Apr 10 15:42:40 CEST 2007t == tt => true
tt =Time.parse(t.to_s)
=> "Tue Apr 10 15:42:40 CEST 2007"t == tt => false
tt < t => true
t.to_s
=> truet == Time.parse("Tue Apr 10 15:42:40 CEST 2007") => false
t > Time.parse("Tue Apr 10 15:42:40 CEST 2007") => true
t > Time.parse("Tue Apr 10 15:42:41 CEST 2007") => false
t < Time.parse("Tue Apr 10 15:42:41 CEST 2007") => true
t > Time.parse("Tue Apr 10 15:42:39 CEST 2007")
As Time#inspect is overridden i don't know how to examine if there are
any differences between the objects created with parse and dup
respectively...
Is this known? Is it a bug or do I misunderstand something?
I could not find it mentioned in the bugtracker or on the 'net with
google.
- Siemen Baader