123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Type::Time::Value

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Time
Instance Chain:
Inherits: Time
Defined in: activerecord/lib/active_record/type/time.rb

Constant Summary

::DateAndTime::Calculations - Included

DAYS_INTO_WEEK, WEEKEND_DAYS

::Time - Inherited

COMMON_YEAR_DAYS_IN_MONTH, DATE_FORMATS

Class Attribute Summary

::Time - Inherited

.zone

Returns the TimeZone for the current request, if this has been set (via Time.zone=).

.zone=

Sets Time.zone to a TimeZone object for the current request/thread.

.zone_default

Class Method Summary

::Time - Inherited

.===

Overriding case equality method so that it returns true for ::ActiveSupport::TimeWithZone instances.

.at
.at_with_coercion

Layers additional behavior on Time.at so that ::ActiveSupport::TimeWithZone and ::ActiveRecord::Type::DateTime instances can be used when called with a single argument.

.at_without_coercion,
.current

Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.

.days_in_month

Returns the number of days in the given month.

.days_in_year

Returns the number of days in the given year.

.find_zone

Returns a TimeZone instance matching the time zone provided.

.find_zone!

Returns a TimeZone instance matching the time zone provided.

.rfc3339

Creates a ::ActiveRecord::Type::Time instance from an RFC 3339 string.

.use_zone

Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

Instance Attribute Summary

::Time - Inherited

#acts_like_time?

Duck-types as a Time-like class.

#blank?

No Time is blank:

::DateAndTime::Compatibility - Included

::DateAndTime::Calculations - Included

#future?

Returns true if the date/time is in the future.

#next_day?
#on_weekday?

Returns true if the date/time does not fall on a Saturday or Sunday.

#on_weekend?

Returns true if the date/time falls on a Saturday or Sunday.

#past?

Returns true if the date/time is in the past.

#prev_day?
#today?

Returns true if the date/time is today.

#tomorrow

Returns a new date/time representing tomorrow.

#tomorrow?

Returns true if the date/time is tomorrow.

#yesterday

Returns a new date/time representing yesterday.

#yesterday?

Returns true if the date/time is yesterday.

Instance Method Summary

::Time - Inherited

#+
#-
#<=>
#advance

Uses Date to provide precise ::ActiveRecord::Type::Time calculations for years, months, and days according to the proleptic Gregorian calendar.

#ago

Returns a new ::ActiveRecord::Type::Time representing the time a number of seconds ago, this is basically a wrapper around the ::Numeric extension.

#at_beginning_of_day
#at_beginning_of_hour
#at_beginning_of_minute
#at_end_of_day

Alias for Time#end_of_day.

#at_end_of_hour

Alias for Time#end_of_hour.

#at_end_of_minute
#at_midday
#at_middle_of_day
#at_midnight
#at_noon
#beginning_of_day

Returns a new ::ActiveRecord::Type::Time representing the start of the day (0:00).

#beginning_of_hour

Returns a new ::ActiveRecord::Type::Time representing the start of the hour (x:00).

#beginning_of_minute

Returns a new ::ActiveRecord::Type::Time representing the start of the minute (x:xx:00).

#ceil,
#change

Returns a new ::ActiveRecord::Type::Time where one or more of the elements have been changed according to the options parameter.

#compare_with_coercion

Layers additional behavior on Time#<=> so that ::ActiveRecord::Type::DateTime and ::ActiveSupport::TimeWithZone instances can be chronologically compared with a ::ActiveRecord::Type::Time.

#compare_without_coercion,
#end_of_day

Returns a new ::ActiveRecord::Type::Time representing the end of the day, 23:59:59.999999.

#end_of_hour

Returns a new ::ActiveRecord::Type::Time representing the end of the hour, x:59:59.999999.

#end_of_minute

Returns a new ::ActiveRecord::Type::Time representing the end of the minute, x:xx:59.999999.

#eql?
#eql_with_coercion

Layers additional behavior on Time#eql? so that ::ActiveSupport::TimeWithZone instances can be eql? to an equivalent ::ActiveRecord::Type::Time.

#eql_without_coercion, #floor,
#formatted_offset

Returns a formatted string of the offset from UTC, or an alternative string if the time zone is already UTC.

#in

Alias for Time#since.

#midday
#middle_of_day

Returns a new ::ActiveRecord::Type::Time representing the middle of the day (12:00).

#midnight
#minus_with_coercion

Time#- can also be used to determine the number of seconds between two ::ActiveRecord::Type::Time instances.

#minus_without_coercion

Alias for Time#-.

#minus_without_duration,
#next_day

Returns a new time the specified number of days in the future.

#next_month

Returns a new time the specified number of months in the future.

#next_year

Returns a new time the specified number of years in the future.

#noon
#plus_without_duration,
#prev_day

Returns a new time the specified number of days ago.

#prev_month

Returns a new time the specified number of months ago.

#prev_year

Returns a new time the specified number of years ago.

#rfc3339

Aliased to xmlschema for compatibility with ::ActiveRecord::Type::DateTime

#sec_fraction

Returns the fraction of a second as a Rational

#seconds_since_midnight

Returns the number of seconds since 00:00:00.

#seconds_until_end_of_day

Returns the number of seconds until 23:59:59.

#since

Returns a new ::ActiveRecord::Type::Time representing the time a number of seconds since the instance time.

#to_default_s,
#to_formatted_s

Alias for Time#to_fs.

#to_fs

Converts to a formatted string.

#to_time

Either return self or the time in the local system timezone depending on the setting of ActiveSupport.to_time_preserves_timezone.

#as_json, #minus_with_duration, #plus_with_duration

::DateAndTime::Calculations - Included

#after?

Returns true if the date/time falls after date_or_time.

#all_day

Returns a ::Range representing the whole day of the current date/time.

#all_month

Returns a ::Range representing the whole month of the current date/time.

#all_quarter

Returns a ::Range representing the whole quarter of the current date/time.

#all_week

Returns a ::Range representing the whole week of the current date/time.

#all_year

Returns a ::Range representing the whole year of the current date/time.

#at_beginning_of_month
#at_beginning_of_quarter
#at_beginning_of_week
#at_beginning_of_year
#at_end_of_month
#at_end_of_quarter
#at_end_of_week
#at_end_of_year
#before?

Returns true if the date/time falls before date_or_time.

#beginning_of_month

Returns a new date/time at the start of the month.

#beginning_of_quarter

Returns a new date/time at the start of the quarter.

#beginning_of_week

Returns a new date/time representing the start of this week on the given day.

#beginning_of_year

Returns a new date/time at the beginning of the year.

#days_ago

Returns a new date/time the specified number of days ago.

#days_since

Returns a new date/time the specified number of days in the future.

#days_to_week_start

Returns the number of days to the start of the week on the given day.

#end_of_month

Returns a new date/time representing the end of the month.

#end_of_quarter

Returns a new date/time at the end of the quarter.

#end_of_week

Returns a new date/time representing the end of this week on the given day.

#end_of_year

Returns a new date/time representing the end of the year.

#last_month

Short-hand for months_ago(1).

#last_quarter
#last_week
#last_weekday
#last_year

Short-hand for years_ago(1).

#monday

Returns Monday of this week assuming that week starts on Monday.

#months_ago

Returns a new date/time the specified number of months ago.

#months_since

Returns a new date/time the specified number of months in the future.

#next_occurring

Returns a new date/time representing the next occurrence of the specified day of week.

#next_quarter

Short-hand for months_since(3).

#next_week

Returns a new date/time representing the given day in the next week.

#next_weekday

Returns a new date/time representing the next weekday.

#prev_occurring

Returns a new date/time representing the previous occurrence of the specified day of week.

#prev_quarter

Short-hand for months_ago(3).

#prev_week

Returns a new date/time representing the given day in the previous week.

#prev_weekday

Returns a new date/time representing the previous weekday.

#quarter

Returns the quarter for a date/time.

#sunday

Returns Sunday of this week assuming that week starts on Monday.

#weeks_ago

Returns a new date/time the specified number of weeks ago.

#weeks_since

Returns a new date/time the specified number of weeks in the future.

#years_ago

Returns a new date/time the specified number of years ago.

#years_since

Returns a new date/time the specified number of years in the future.

#copy_time_to, #days_span, #first_hour, #last_hour

::DateAndTime::Zones - Included

#in_time_zone

Returns the simultaneous time in Time.zone if a zone is given or if Time.zone_default is set.

#time_with_zone