Flowdock
method

now

Importance_2
Ruby on Rails latest stable (v4.1.8) - 1 note - 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
Show source
Register or log in to add new notes.
July 15, 2009
0 thanks

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.