method
now
v4.2.1 -
Show latest stable
- Class:
ActiveSupport::TimeZone
now()public
Returns an ActiveSupport::TimeWithZone instance representing the current time in the time zone represented by self.
Time.zone = 'Hawaii' # => "Hawaii" Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00
1Note
Time.now in views.
Be careful if you use Time.now in views with time zone support enabled, as this will not actually do the time zone conversion.
Instead, use Time.zone.now.