Hello guys,
Wanna to get the date difference in terms of days?
eg.
date_x = Time.now.to_date
date_y = Date.parse('2012-05-20')
passed_days = (date_x.to_date - date_y.to_date).to_i
passed_days should give the date difference in days.
No comments:
Post a Comment