Sha256: f5146091d3054ccf6ebfb0025f951b1e73f2c208c10646181bc62d9bf721bb15

Contents?: true

Size: 365 Bytes

Versions: 7

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

module Dynamoid
  module DynamodbTimeZone
    def self.in_time_zone(value)
      case Dynamoid::Config.dynamodb_timezone
      when :utc
        value.utc.to_datetime
      when :local
        value.getlocal.to_datetime
      else
        value.in_time_zone(Dynamoid::Config.dynamodb_timezone).to_datetime
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dynamoid-3.5.0 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.4.1 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.4.0 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.3.0 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.2.0 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.1.0 lib/dynamoid/dynamodb_time_zone.rb
dynamoid-3.0.0 lib/dynamoid/dynamodb_time_zone.rb