Created
July 14, 2013 12:22
-
-
Save DouweM/5994113 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datetime = DateTime.parse('2013-07-14T09:00') | |
tz = datetime.in_time_zone # => Sun, 14 Jul 2013 09:00:00 UTC +00:00 | |
tz.instance_variable_set(:@time_zone, ::Time.find_zone!("CET")) | |
tz.instance_variable_set(:@period, tz.send(:get_period_and_ensure_valid_local_time)) | |
tz # => Sun, 14 Jul 2013 09:00:00 CEST +02:00 | |
# :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment