Skip to content

Instantly share code, notes, and snippets.

Created January 16, 2012 01:41
Show Gist options
  • Save anonymous/1618523 to your computer and use it in GitHub Desktop.
Save anonymous/1618523 to your computer and use it in GitHub Desktop.
Subtracting dates
birth = Time.utc(2011, "aug", 24)
now = Time.now
age = now - birth
output = 'Tom was born on ' + birth.strftime("%m/%d/%Y")
output += "<br/> She is " + age
return output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment