Sha256: b6cadf5d8bad9834ae5288277f7cd28a4bb860ca53ea11e7e2705302b7d600e7

Contents?: true

Size: 374 Bytes

Versions: 6

Compression:

Stored size: 374 Bytes

Contents

class Time
  #Useful but not thread safe!!!!
  def convert_time_zone(to_zone)
    original_zone = ENV["TZ"]
    utc_time = dup.gmtime
    ENV["TZ"] = to_zone
    to_zone_time = utc_time.localtime
    ENV["TZ"] = original_zone
    return to_zone_time
  end
end

class DateTime
  def convert_time_zone(to_zone)
    self.to_time.convert_time_zone(to_zone).to_datetime
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
facebook-google-calendar-sync-0.2.2 lib/time_zone_hack.rb
facebook-google-calendar-sync-0.2.1 lib/time_zone_hack.rb
facebook-google-calendar-sync-0.2.0 lib/time_zone_hack.rb
facebook-google-calendar-sync-0.1.0 lib/time_zone_hack.rb
facebook-google-calendar-sync-0.0.2 lib/time_zone_hack.rb
facebook-google-calendar-sync-0.0.1 lib/time_zone_hack.rb