Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: v0.14.3
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (17 sloc) 0.451 kB
require 'parsedate'
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module String #:nodoc:
# Converting strings to other objects
module Conversions
# Form can be either :utc (default) or :local.
def to_time(form = :utc)
::Time.send(form, *ParseDate.parsedate(self))
end
def to_date
::Date.new(*ParseDate.parsedate(self)[0..2])
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.