Class/Module Index [+]

Quicksearch

Sequel::Timezones

Attributes

application_timezone[R]
database_timezone[R]
typecast_timezone[R]

Public Instance Methods

application_to_database_timestamp(v) click to toggle source

Convert the given Time/DateTime object into the database timezone, used when literalizing objects in an SQL string.

# File lib/sequel/timezones.rb, line 21
def application_to_database_timestamp(v)
  convert_output_timestamp(v, Sequel.database_timezone)
end
database_to_application_timestamp(v) click to toggle source

Convert the given object into an object of Sequel.datetime_class in the application_timezone. Used when coverting datetime/timestamp columns returned by the database.

# File lib/sequel/timezones.rb, line 28
def database_to_application_timestamp(v)
  convert_timestamp(v, Sequel.database_timezone)
end
default_timezone=(tz) click to toggle source

Sets the database, application, and typecasting timezones to the given timezone.

# File lib/sequel/timezones.rb, line 33
def default_timezone=(tz)
  self.database_timezone = tz
  self.application_timezone = tz
  self.typecast_timezone = tz
end
typecast_to_application_timestamp(v) click to toggle source

Convert the given object into an object of Sequel.datetime_class in the application_timezone. Used when typecasting values when assigning them to model datetime attributes.

# File lib/sequel/timezones.rb, line 42
def typecast_to_application_timestamp(v)
  convert_timestamp(v, Sequel.typecast_timezone)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.