ActiveSupport、Numeric::Time
>> require "rubygems" => true >> require "active_support" => true >> Time.local(2008) => Tue Jan 01 00:00:00 +0900 2008 >> 1.seconds.since(Time.local(2008)) => Tue Jan 01 00:00:01 +0900 2008 >> 1.second.since(Time.local(2008)) => Tue Jan 01 00:00:01 +0900 2008 >> 1.minutes.since(Time.local(2008)) => Tue Jan 01 00:01:00 +0900 2008 >> 1.minute.since(Time.local(2008)) => Tue Jan 01 00:01:00 +0900 2008 >> 1.hours.since(Time.local(2008)) => Tue Jan 01 01:00:00 +0900 2008 >> 1.hour.since(Time.local(2008)) => Tue Jan 01 01:00:00 +0900 2008 >> 1.days.since(Time.local(2008)) => Wed Jan 02 00:00:00 +0900 2008 >> 1.day.since(Time.local(2008)) => Wed Jan 02 00:00:00 +0900 2008 >> 1.weeks.since(Time.local(2008)) => Tue Jan 08 00:00:00 +0900 2008 >> 1.week.since(Time.local(2008)) => Tue Jan 08 00:00:00 +0900 2008 >> 1.fortnights.since(Time.local(2008)) => Tue Jan 15 00:00:00 +0900 2008 >> 1.fortnight.since(Time.local(2008)) => Tue Jan 15 00:00:00 +0900 2008 >> 1.months.since(Time.local(2008)) => Fri Feb 01 00:00:00 +0900 2008 >> 1.month.since(Time.local(2008)) => Fri Feb 01 00:00:00 +0900 2008 >> 1.years.since(Time.local(2008)) => Thu Jan 01 00:00:00 +0900 2009 >> 1.year.since(Time.local(2008)) => Thu Jan 01 00:00:00 +0900 2009 >> 1.year.ago(Time.local(2008)) => Mon Jan 01 00:00:00 +0900 2007 >> 1.year.until(Time.local(2008)) => Mon Jan 01 00:00:00 +0900 2007 >> 1.year.from_now(Time.local(2008)) => Thu Jan 01 00:00:00 +0900 2009 >> 1.year.from_now => Thu Oct 08 07:50:19 +0900 2009 >> 1.year.ago => Mon Oct 08 07:50:37 +0900 2007
引数があるときには、from_now という名前には、ちょっと違和感?