I have these dates and times:
schedule.day_start # => 2014-09-27 15:30:00 UTC date_now = Time.now # => 2014-09-27 15:11:14 +0200 date_now + 60.minutes # => 2014-09-27 16:11:14 +0200 I am trying to detect all schedules that start 60 minutes or less before day_start. With the following code, I get as a response "NO" instead of "YES".
if schedule.day_start < (Time.now + 60.minutes) "YES" else "NO" end Why is 2014-09-27 15:30:00 UTC bigger than 2014-09-27 16:11:14 +0200?