Getting dates in different convenient string representations and other objects
Methods
Constants
| DATE_FORMATS | = | { :short => "%e %b", :long => "%B %e, %Y" |
Public Instance methods
To be able to keep Dates and Times interchangeable on conversions
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 22
22: def to_date
23: self
24: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 17
17: def to_formatted_s(format = :default)
18: DATE_FORMATS[format] ? strftime(DATE_FORMATS[format]).strip : to_default_s
19: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 26
26: def to_time(form = :local)
27: ::Time.send(form, year, month, day)
28: end