Getting dates in different convenient string representations and other objects
Methods
Constants
DATE_FORMATS | = | { :short => "%e %b", :long => "%B %e, %Y" } |
Instance Public methods
To be able to keep Dates and Times interchangeable on conversions
Source: show
# File rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 21 def to_date self end
Source: show
# File rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 16 def to_formatted_s(format = :default) DATE_FORMATS[format] ? strftime(DATE_FORMATS[format]).strip : to_default_s end
Source: show
# File rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 25 def to_time(form = :local) if respond_to?(:hour) ::Time.send(form, year, month, day, hour, min, sec) else ::Time.send(form, year, month, day) end end
Source: show
# File rails/activesupport/lib/active_support/core_ext/date/conversions.rb, line 33 def xmlschema to_time.xmlschema end