def to_local(time)
      raise ArgumentError, 'time must be specified' unless time

      Timestamp.for(time) do |ts|
        TimestampWithOffset.set_timezone_offset(ts, period_for(ts).offset)
      end
    end
def to_local(time)
      raise ArgumentError, 'time must be specified' unless time

      Timestamp.for(time) do |ts|
        TimestampWithOffset.set_timezone_offset(ts, period_for(ts).offset)
      end
    end
Converts a time to the local time for the time zone.

 The result will be of type {TimeWithOffset} (if passed a `Time`),
 {DateTimeWithOffset} (if passed a `DateTime`) or {TimestampWithOffset} (if
 passed a {Timestamp}). {TimeWithOffset}, {DateTimeWithOffset} and
 {TimestampWithOffset} are subclasses of `Time`, `DateTime` and {Timestamp}
 that provide additional information about the local result.

 Unlike {utc_to_local}, {to_local} takes the UTC offset of the given time
 into consideration.

 @param time [Object] a `Time`, `DateTime` or {Timestamp}.
 @return [Object] the local equivalent of `time` as a {TimeWithOffset},
   {DateTimeWithOffset} or {TimestampWithOffset}.
 @raise [ArgumentError] if `time` is `nil`.
 @raise [ArgumentError] if `time` is a {Timestamp} that does not have a
   specified UTC offset.