you are in: codestackercodes [RSS]age calculation

age calculation Delicious

show/hide lines
   1  # one method
   2  def age
   3   ((Time.now - birthday)/(60*60*24)/365.2422).to_i
   4  end
   5  
   6  # second method
   7  def birthday
   8      @birthday = Time.local( birth_year, birth_month, birth_day )
   9    end
  10    
  11    def age
  12      ((Time.now - birthday) / 1.year).to_i
  13    end 
created by leozera — 19 September 2008 — get a short url — tags: age ruby time embed

Comments

   1  lbTSNt  <a href="http://qnqfeghnpolo.com/">qnqfeghnpolo</a>, [url=http://evtfjqcltcuv.com/]evtfjqcltcuv[/url], [link=http://cqzxymdrqfow.com/]cqzxymdrqfow[/link], http://jxvsxviqxdtt.com/

ekbjzmuw — 19 October / 23:13
   1  kWM1Ts  <a href="http://royfupzegzsv.com/">royfupzegzsv</a>, [url=http://cwnkjitowdlr.com/]cwnkjitowdlr[/url], [link=http://ayubrmhvqdts.com/]ayubrmhvqdts[/link], http://wuyolicozslf.com/

mhpxghwjimx — 12 November / 04:37


We dont send spam :)

If checked, it's highlights your comment