From: sam.saffron@... Date: 2018-06-18T10:36:12+00:00 Subject: [ruby-core:87507] [Ruby trunk Feature#14850] Add official API for setting timezone on Time Issue #14850 has been reported by sam.saffron (Sam Saffron). ---------------------------------------- Feature #14850: Add official API for setting timezone on Time https://bugs.ruby-lang.org/issues/14850 * Author: sam.saffron (Sam Saffron) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Only way of setting zone on a Time object appears to be via marshalling and messing with ENV. ``` >> ENV['TZ'] = 'America/New_York' >> Time.now.zone => "EDT" >> ENV['TZ'] = 'Europe/London' >> Time.now.zone => "BST" ``` Is there any particular reason there is no direct, supported API for setting timezone? ActiveSupport carries http://api.rubyonrails.org/v5.1/classes/ActiveSupport/TimeWithZone.html for this exact reason, it would be nice for core Ruby to support this out-of-the-box -- https://bugs.ruby-lang.org/ Unsubscribe: