From: Ryan Victory Date: 2013-02-23T04:47:31+09:00 Subject: Re: Difference of 2 dates interms of years. OK, now I'm just baffled...you are looking for years, so you post a "thing you tried" which doesn't even reference years in the slightest. Where did you get that code? Just a random post from somewhere or did you write that gem yourself (no pun intended). This is getting too obvious that you aren't here for "help" you're here for programmers to work for you. You even went so far as to change your name from "Love you Ruby" to this so people would help you again. It's just pathetic. -Ryan On 2/22/13 1:43 PM, Xavier R. wrote: > Matt Mongeau wrote in post #1098484: >> Post some things you've tried. > > I tried the below : > > def calculate_difference > minutes = (Date.parse("2009-06-20") - Date.today).to_i / 60 > days = minutes / (24*60) > minutes -= days * 24*60 > hours = minutes / 60 > minutes -= hours * 60 > "#{days}d#{hours}h#{minutes}m" > end > > which is not the one - I am looking for. :) >