to_s

to_s(format = :default) Instance Public methods :db format outputs time in UTC; all others output time in local. Uses TimeWithZone's strftime, so %Z and %z work correctly. to_formatted_s

to_time

to_time() Instance Public methods Return an instance of Time in the system timezone.

today?

today?() Instance Public methods Returns true if the current object's time falls within the current day.

tv_sec

tv_sec() Instance Public methods Alias for: to_i

utc

utc() Instance Public methods Returns a Time or DateTime instance that represents the time in UTC. comparable_time getgm getutc gmtime

utc?

utc?() Instance Public methods Returns true if the current time zone is set to UTC. Time.zone = 'UTC' # => 'UTC' Time.zone.now.utc? # => true Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' Time.zone.now.utc? # => false gmt?

utc_offset

utc_offset() Instance Public methods Returns the offset from current time to UTC time in seconds. gmt_offset gmtoff

xmlschema

xmlschema(fraction_digits = 0) Instance Public methods Also aliased as: iso8601

zone

zone() Instance Public methods Time uses zone to display the time zone abbreviation, so we're duck-typing it.

[]

[](arg) Class Public methods Locate a specific time zone object. If the argument is a string, it is interpreted to mean the name of the timezone to locate. If it is a numeric value it is either the hour offset, or the second offset, of the timezone to find. (The first one with that offset will be returned.) Returns nil if no such time zone is known to the system.