Sha256: 89943c18aded2f6c9a3a2234e1e0f386c536a0565932a51f9532be9f71ec2ae3
Contents?: true
Size: 469 Bytes
Versions: 11
Compression:
Stored size: 469 Bytes
Contents
class Time def to_json(*a) %("#{to_s(:json)}") end def to_s_with_json(*args) if args[0] == :json getutc.strftime("%Y/%m/%d %H:%M:%S +0000") else to_s_without_json *args end end alias_method :to_s_without_json, :to_s alias_method :to_s, :to_s_with_json def self.json_create string return nil if string.nil? d = DateTime.parse(string).new_offset self.utc(d.year, d.month, d.day, d.hour, d.min, d.sec) end end
Version data entries
11 entries across 11 versions & 2 rubygems