Module: Toggl::Worktime::Time

Defined in:
lib/toggl/worktime/time.rb

Overview

Timezone

Class Method Summary collapse

Class Method Details

.zone_offset(timezone) ⇒ Object

Seconds



8
9
10
11
12
13
14
# File 'lib/toggl/worktime/time.rb', line 8

def self.zone_offset(timezone)
  tz = ENV['TZ']
  ENV['TZ'] = timezone
  offset = ::Time.now.utc_offset
  ENV['TZ'] = tz
  offset
end