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 21
21: def to_date
22: self
23: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 16
16: def to_formatted_s(format = :default)
17: DATE_FORMATS[format] ? strftime(DATE_FORMATS[format]).strip : to_default_s
18: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 25
25: def to_time(form = :local)
26: if respond_to?(:hour)
27: ::Time.send(form, year, month, day, hour, min, sec)
28: else
29: ::Time.send(form, year, month, day)
30: end
31: end
[ show source ]
# File vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 33
33: def xmlschema
34: to_time.xmlschema
35: end