Why is Rails date comparison not working?
Posted
by revgum
on Stack Overflow
See other posts from Stack Overflow
or by revgum
Published on 2010-05-18T18:52:08Z
Indexed on
2010/05/18
19:20 UTC
Read the original article
Hit count: 221
ruby-on-rails
|datetime
What am I missing here, it's driving me crazy..
>> user.current_login_at.utc > 24.hours.ago.utc
=> false
>> 24.hours.ago.utc
=> Mon May 17 18:46:16 UTC 2010
>> user.current_login_at.utc
=> Mon May 17 15:47:44 UTC 2010
user.current_login_at was 27 hours ago, yet the greater than comparison says it was not greater than 24 hours ago. It leaves me scratching my head..
© Stack Overflow or respective owner