Skip to content

Instantly share code, notes, and snippets.

@dannymcc
Created June 13, 2010 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannymcc/436774 to your computer and use it in GitHub Desktop.
Save dannymcc/436774 to your computer and use it in GitHub Desktop.
>> now = Time.now
>> now.to_s
# => "Mon Mar 05 18:30:48 2007"
>> now.to_s(:db)
# => "2007-03-05 18:30:48"
>> now.to_s(:short)
# => "05 Mar 18:30"
>> now.to_s(:long)
# => "March 05, 2007 18:30"
>> now.to_s(:rfc822)
# => "Mon, 05 Mar 2007 18:30:48 -0600"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment