I have dstring
as saved in UTC. While I have user\'s timezone\'s offset standard_offset
What I want to show that date in user\'s timezone after con
Apparently this is an issue with the Ruby standard library.
Sources:
http://rubydoc.info/gems/tzinfo/file/README.md
Note that the local Time returned will have a UTC timezone (local.zone will return "UTC"). This is because the Ruby Time class only supports two timezones: UTC and the current system local timezone.
http://librelist.com/browser//usp.ruby/2011/9/24/unix-time-and-the-ruby-time-class/
Modern kernels do not know nor care about timezones. Conversions from UTC to the local timezone (and vice versa) are done in user space[2]. Different processes running concurrently on the same machine do not necessarily share the same local timezone.
Process timezone
The "TZ" environment variable controls the timezone for a given process, and thus the timezone attached to a Ruby Time object. If "TZ" is unset, the timezone of the process is implementation-defined.
As far as I can tell, everything related to time zones that is in Rails was built by the Rails core team. Ruby only handles as much time-related functionality as Unix provides and probably expects the user to handle the reset.