module XeroGateway::Dates::ClassMethods
Public Instance Methods
format_date(time)
click to toggle source
# File lib/xero_gateway/dates.rb, line 8 def format_date(time) return time.strftime("%Y-%m-%d") end
format_date_time(time)
click to toggle source
# File lib/xero_gateway/dates.rb, line 12 def format_date_time(time) return time.strftime("%Y%m%d%H%M%S") end
parse_date(time)
click to toggle source
# File lib/xero_gateway/dates.rb, line 16 def parse_date(time) Date.civil(time[0..3].to_i, time[5..6].to_i, time[8..9].to_i) end
parse_date_time(time)
click to toggle source
# File lib/xero_gateway/dates.rb, line 20 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
parse_date_time_utc(time)
click to toggle source
# File lib/xero_gateway/dates.rb, line 24 def parse_date_time_utc(time) Time.utc(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