Sha256: e69a0c7fcf91e3e20a5d1697c1695aee38249da9f32623aefc7eeb0472d71e8f
Contents?: true
Size: 613 Bytes
Versions: 20
Compression:
Stored size: 613 Bytes
Contents
module XeroGateway module Dates def self.included(base) base.extend(ClassMethods) end module ClassMethods def format_date(time) return time.strftime("%Y-%m-%d") end def format_date_time(time) return time.strftime("%Y%m%d%H%M%S") end def parse_date(time) Date.civil(time[0..3].to_i, time[5..6].to_i, time[8..9].to_i) end def parse_date_time(time) Time.local(time[0..3].to_i, time[5..6].to_i, time[8..9].to_i, time[11..12].to_i, time[14..15].to_i, time[17..18].to_i) end end end end
Version data entries
20 entries across 20 versions & 2 rubygems