class DateTime
  # @api public
  def self.to_mongo(value)
    value.to_time
  end

  # @api public
  def self.from_mongo(value)
    value.to_datetime
  end
end # DateTime

class DateTime
  # @api public
  def self.to_mongo(value)
    value.to_time.utc
  end

  # @api public
  def self.from_mongo(value)
    value.to_datetime
  end
end # DateTime

Convert DateTime to utc time for mongo driver
Convert DateTime to utc time for mongo driver
