Module: Sequel::Timezones

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

### Methods

application_to_database_timestamp database_to_application_timestamp default_timezone= typecast_to_application_timestamp

### Attributes

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

### Public Instance methods

application_to_database_timestamp(v)

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

database_to_application_timestamp(v)

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

default_timezone=(tz)

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

typecast_to_application_timestamp(v)

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]