Module: TimeWithZonePatch

Defined in:
lib/dynamic_time_zone/time_with_zone_patch.rb

Instance Method Summary collapse

Instance Method Details

#formatted_offset(*args) ⇒ Object



11
12
13
# File 'lib/dynamic_time_zone/time_with_zone_patch.rb', line 11

def formatted_offset(*args)
  DynamicTimeZone.enabled ? '+0000' : super
end

#localtime(utc_offset = nil) ⇒ Object Also known as: getlocal



4
5
6
7
8
# File 'lib/dynamic_time_zone/time_with_zone_patch.rb', line 4

def localtime(utc_offset = nil)
  return super unless DynamicTimeZone.enabled

  utc + (utc_offset || 0).seconds
end