Sha256: 22cfa669522570a8d43eee4d6a6fddd56ec135b99ffe0366336325f56ee6cfcb
Contents?: true
Size: 470 Bytes
Versions: 13
Compression:
Stored size: 470 Bytes
Contents
class Time def self.iso8601(time) cached_date_formatter("yyyy-MM-dd'T'HH:mm:ss'Z'"). dateFromString(time) end private def self.cached_date_formatter(dateFormat) Thread.current[:date_formatters] ||= {} Thread.current[:date_formatters][dateFormat] ||= NSDateFormatter.alloc.init.tap do |formatter| formatter.dateFormat = dateFormat formatter.timeZone = NSTimeZone.timeZoneWithAbbreviation "UTC" end end end
Version data entries
13 entries across 13 versions & 1 rubygems