Skip to content

Instantly share code, notes, and snippets.

@xadn
Created October 24, 2012 16:43
Show Gist options
  • Save xadn/3947241 to your computer and use it in GitHub Desktop.
Save xadn/3947241 to your computer and use it in GitHub Desktop.
stamp example
date = Date.new(2011, 6, 9)
date.stamp("March 1, 1999") #=> "June 9, 2011"
date.stamp("Jan 1, 1999") #=> "Jun 9, 2011"
date.stamp("Jan 01") #=> "Jun 09"
date.stamp("Sunday, May 1, 2000") #=> "Thursday, June 9, 2011"
date.stamp("Sun Aug 5") #=> "Thu Jun 9"
date.stamp("12/31/99") #=> "06/09/11"
date.stamp("DOB: 12/31/2000") #=> "DOB: 06/09/2011"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment