Displaying 2 results from an estimated 2 matches for "other_date".
Did you mean:
other_data
2008 May 03
11
Date comparisons
I occasionally get this error:
1)
''A puzzle once featured, should no longer be nominated'' FAILED
expected: Sun May 04 09:10:26 -0700 2008,
got: Sun May 04 09:10:26 -0700 2008 (using ==)
./spec/models/puzzle_spec.rb:180:
So, the dates looks the same to me. Any ideas for how to debug?
Joe
2008 Nov 21
5
Getting the number of years between two dates
Hey,
I need to get the number of years (as a number) between two dates. Here is
what I have as a helper.
# Returns the number of years between now and the specified date.
def years_ago(date)
dateDifference = DateTime.now - date
results =Date.day_fraction_to_time(dateDifference)
return results[0] / 24 / 365;
end
I''m sure there is a better way to do this. What is it?