Sha256: ec1adde846d4ed0b2d8d2485b5d0394a4ad9eb17727a9f94a64d3e57f277203a

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 Bytes

Contents

require "time"

module Coolkit
  # Convert a `UTC` {Time} object to `EST`.
  #
  # @param time [Time]
  # @raise [ArgumentError] Unless passed a `UTC` formatted Time object.
  # @return [Time]
  def self.to_est(time)
    raise ArgumentError "argument is not in UTC format" unless time.utc?()
    return time + Time.zone_offset("EST")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coolkit-0.2.2 lib/coolkit/time.rb
coolkit-0.2.1 lib/coolkit/time.rb