Module Sequel::Timezones
In: lib/sequel/timezones.rb

Methods

Attributes

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

Public Instance methods

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

[Source]

    # File lib/sequel/timezones.rb, line 21
21:     def application_to_database_timestamp(v)
22:       convert_output_timestamp(v, Sequel.database_timezone)
23:     end

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.

[Source]

    # File lib/sequel/timezones.rb, line 28
28:     def database_to_application_timestamp(v)
29:       convert_timestamp(v, Sequel.database_timezone)
30:     end

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

[Source]

    # File lib/sequel/timezones.rb, line 33
33:     def default_timezone=(tz)
34:       self.database_timezone = tz
35:       self.application_timezone = tz
36:       self.typecast_timezone = tz
37:     end

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.

[Source]

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

[Validate]