The DateTime
class does not seem to support zone data as zone names. The Time
class, however, does it right. So or do this:
require 'date' require 'time' Time.parse('...').strftime('%Z')
Or, if you already have data in DateTime
format, then:
Time.parse(DateTime.parse('...').to_s).strftime('%Z')
source share