#to_datetime doesn't exist unless require 'time'

See http://devblog.avdi.org/2009/10/25/iso8601-dates-in-ruby/

This adds #to_datetime