Module: Dynamoid::DynamodbTimeZone

Defined in:
lib/dynamoid/dynamodb_time_zone.rb

Class Method Summary collapse

Class Method Details

.in_time_zone(value) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/dynamoid/dynamodb_time_zone.rb', line 6

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