zone=

zone=(time_zone) Class Public methods Sets Time.zone to a TimeZone object for the current request/thread. This method accepts any of the following: A Rails TimeZone object. An identifier for a Rails TimeZone object (e.g., âEastern Time (US & Canada)â, -5.hours). A TZInfo::Timezone object. An identifier for a TZInfo::Timezone object (e.g., âAmerica/New_Yorkâ). Here's an example of how you might set Time.zone on a per request basis and reset it when the request is done.

zone

zone() Class Public methods Returns the TimeZone for the current request, if this has been set (via ::zone=). If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone.

use_zone

use_zone(time_zone) Class Public methods Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

find_zone!

find_zone!(time_zone) Class Public methods Returns a TimeZone instance or nil, or raises an ArgumentError for invalid timezones.

find_zone

find_zone(time_zone) Class Public methods

days_in_month

days_in_month(month, year = now.year) Class Public methods Return the number of days in the given month. If no year is specified, it will use the current year.

current

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

at_without_coercion

at_without_coercion(*args) Class Public methods Alias for: at

at_with_coercion

at_with_coercion(*args) Class Public methods Layers additional behavior on ::at so that ActiveSupport::TimeWithZone and DateTime instances can be used when called with a single argument at

at

at(*args) Class Public methods Also aliased as: at_without_coercion