acts_like_date?

acts_like_date?() Instance Public methods Duck-types as a Date-like class. See Object#acts_like?.

<=>

<=>(other) Instance Public methods Layers additional behavior on DateTime#<=> so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime.

current

current() Class Public methods Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.

civil_from_format

civil_from_format(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0) Class Public methods Returns DateTime with local offset for given year if format is local else offset is zero. DateTime.civil_from_format :local, 2012 # => Sun, 01 Jan 2012 00:00:00 +0300 DateTime.civil_from_format :local, 2012, 12, 17 # => Mon, 17 Dec 2012 00:00:00 +0000

in_time_zone

in_time_zone(zone = ::Time.zone) Instance Public methods Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set. Otherwise, it returns the current time. Time.zone = 'Hawaii' # => 'Hawaii' DateTime.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 This method is similar to Time#localtime, except that it uses Time.zone as the local zone instead

yesterday

yesterday() Instance Public methods Returns a new date/time representing yesterday.

years_since

years_since(years) Instance Public methods Returns a new date/time the specified number of years in the future.

years_ago

years_ago(years) Instance Public methods Returns a new date/time the specified number of years ago.

weeks_since

weeks_since(weeks) Instance Public methods Returns a new date/time the specified number of weeks in the future.

weeks_ago

weeks_ago(weeks) Instance Public methods Returns a new date/time the specified number of weeks ago.