I writing a Ruby program. I need a way to get something like
require "tzinfo" can't get my current timezone. (Note that
Time.now.zone can get things like
EST but I need the tz database format, e.g.
America/New_York.) Though the eazy way to do this is to just have the user set
TZ='America/New_York'; export TZ or
tzselect. I'm looking for a way to do this without having the user set
TZ. Is there some system file I can load, or a network location I can query?
I need the timezone for things like.
require "active_support/core_ext/time/zones" Time.zone = ENV['TZ'] p Time.zone.now # Returns current time in the local time zone using ActiveSupport.