class Util

Public Class Methods

parse_dot_net_json_datetime(datestring) click to toggle source

Modified from stackoverflow.com/questions/1272195/c-sharp-serialized-json-date-to-ruby

# File lib/miiCardConsumers.rb, line 971
def self.parse_dot_net_json_datetime(datestring)
  seconds_since_epoch = (datestring.scan(/[0-9]+/)[0].to_i) / 1000.0
  return DateTime.strptime(seconds_since_epoch.to_s, '%s')
end