Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007
- date.to_formatted_s(:db) # => "2007-11-10"
- date.to_s(:db) # => "2007-11-10"
- date.to_formatted_s(:short) # => "10 Nov"
- date.to_formatted_s(:long) # => "November 10, 2007"
- date.to_formatted_s(:long_ordinal) # => "November 10th, 2007"
- date.to_formatted_s(:rfc822) # => "10 Nov 2007"
- time = Time.now # => Thu Jan 18 06:10:17 CST 2007
- time.to_formatted_s(:time) # => "06:10:17"
- time.to_s(:time) # => "06:10:17"
- time.to_formatted_s(:db) # => "2007-01-18 06:10:17"
- time.to_formatted_s(:number) # => "20070118061017"
- time.to_formatted_s(:short) # => "18 Jan 06:10"
- time.to_formatted_s(:long) # => "January 18, 2007 06:10"
- time.to_formatted_s(:long_ordinal) # => "January 18th, 2007 06:10"
- time.to_formatted_s(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600"
Add Comment
Please, Sign In to add comment