Sha256: 5062558cb43249696bf430f09686403fdbd65cce694e459507e21ec078659ed8

Contents?: true

Size: 500 Bytes

Versions: 1

Compression:

Stored size: 500 Bytes

Contents

module ActiveSupport
  class TimeWithZone
    def time_zone=(new_zone)
      ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone.new(new_zone), time)
    end

    def time_zone_name
      time_zone.name
    end

    def truncated_time
      ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone.new('UTC'), time)
    end

    def truncated_time_as_string
      truncated_time.to_s
    end
  end

  class TimeZone
    def freeze
      tzinfo; utc_offset;
      super
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
greenwich-0.0.2 lib/greenwich/time_with_zone.rb