Class/Module Index [+]

Quicksearch

ActiveSupport::CoreExtensions::DateTime::Calculations::ClassMethods

Public Instance Methods

current() click to toggle source
# File lib/active_support/core_ext/date_time/calculations.rb, line 23
def current
  ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
end
local_offset() click to toggle source

DateTimes aren't aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone

# File lib/active_support/core_ext/date_time/calculations.rb, line 19
def local_offset
  ::Time.local(2007).utc_offset.to_r / 86400
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.