[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Age to birth year

eggie5

9/25/2007 5:47:00 PM

Given the string "18" which is the age of a person, how can I get the
year of birth?

2 Answers

Guest

9/25/2007 5:55:00 PM

0

eggie5 schrieb:
> Given the string "18" which is the age of a person, how can I get the
> year of birth?
Time.now.year - 18

Regards
Jan

Guest

9/25/2007 5:57:00 PM

0

eggie5 schrieb:
> Given the string "18" which is the age of a person, how can I get the
> year of birth?
Time.now.year - '18'.to_i

But this is only an approximation. ;)

Regards
Jan