Parent

Included Modules

Files

String

Public Instance Methods

to_date() click to toggle source

Parse data from string.

# File lib/facets/standard/facets/date.rb, line 427
def to_date
  #::Date::civil(*ParseDate.parsedate(self)[0..2])
  ::Date.new(*::Date._parse(self, false).values_at(:year, :mon, :mday))
end
to_datetime() click to toggle source

Convert string to DateTime.

# File lib/facets/standard/facets/date.rb, line 421
def to_datetime
  date = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 }
  ::DateTime.civil(*date)
end
to_time(form = :utc) click to toggle source
# File lib/facets/standard/facets/date.rb, line 416
def to_time(form = :utc)
  ::Time.__send__("#{form}_time", *::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map{|arg| arg || 0 })
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.