class method
self.current
Ruby on Rails 4.0.13
Since v3.0.20Signature
self.current()
Returns Time.zone.now.to_datetime when Time.zone or config.time_zone are set, otherwise returns Time.now.to_datetime.
Source
# File activesupport/lib/active_support/core_ext/date_time/calculations.rb, line 15
def current
::Time.zone ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
end
Defined in activesupport/lib/active_support/core_ext/date_time/calculations.rb line 15
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateTime