Times and DateTimes returned by utc_to_local are always returned as UTC times that should be interpreted as local time.
For example,
Timezone.get('America/New_York').utc_to_local(Time.utc(2006,4,17,15,8,0)).to_s
returns "Mon Apr 17 11:08:00 UTC 2006" to represent 11:08:00 EDT.
It would be helpful if Times and DateTimes returned by utc_to_local would contain the appropriate offset and zone identifier.
This would allow the times to be converted back to UTC and make the job of formatting them for display and including
the zone identifier easier.
For DateTimes, the new_offset function can be used to construct a new DateTime with the correct offset. For Times, this
is likely to be more difficult as the zone information appears to always be read straight from the system. |