Sha256: 79f052171032105853dd840f7d04690dad98a13642467bb773c13372f6515b81

Contents?: true

Size: 365 Bytes

Versions: 1

Compression:

Stored size: 365 Bytes

Contents

require 'tzinfo'
require "active_support/core_ext"
require "time_zone_ext/version"

module TimeZoneExt
  def strptime(date, format)
    if format =~ /%z/i
      DateTime.strptime(date, format).in_time_zone
    else
      DateTime.strptime("#{date} zone#{name}", "#{format} zone%z").in_time_zone
    end
  end
end

ActiveSupport::TimeZone.send :include, TimeZoneExt

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
time_zone_ext-0.0.2 lib/time_zone_ext.rb